calculate remain courses