public class Main {
    public static void main(String[] args){
        int a = 40;
        int c = 212;
        int result = (- 8 + 22) * a - 10 + c / 2;
        System.out.println(result);
    }
}