Determination of valence of Cu in superconducting La2-x(Sr,Ba)xCuO