Electronic structure and effective Hamiltonian in perovskite Mn oxides