Cohomological dimension of complexes