calculation of the teacher's salary