import java.util.*;

public class Main {

    public static void main(String [] commandLineArgument){

        Scanner input = new Scanner(System.in);
        int n = input.nextInt() , m = input.nextInt();
        int answer = (m * (m - 1))/2;
        answer += (n * (n - 1))/2;
        System.out.println(answer);
        input.close();

    }

}
 import java.util.*; util.* java public class Main {

    public static void main(String [] commandLineArgument){

        Scanner input = new Scanner(System.in);
        int n = input.nextInt() , m = input.nextInt();
        int answer = (m * (m - 1))/2;
        answer += (n * (n - 1))/2;
        System.out.println(answer);
        input.close();

    }

} Main public static void main(String [] commandLineArgument){

        Scanner input = new Scanner(System.in);
        int n = input.nextInt() , m = input.nextInt();
        int answer = (m * (m - 1))/2;
        answer += (n * (n - 1))/2;
        System.out.println(answer);
        input.close();

    } main {

        Scanner input = new Scanner(System.in);
        int n = input.nextInt() , m = input.nextInt();
        int answer = (m * (m - 1))/2;
        answer += (n * (n - 1))/2;
        System.out.println(answer);
        input.close();

    } Scanner input = new Scanner(System.in); input new Scanner(System.in) int n = input.nextInt() n input.nextInt() input.nextInt input m = input.nextInt(); m input.nextInt() input.nextInt input int answer = (m * (m - 1))/2; answer (m * (m - 1))/2 (m * (m - 1)) m (m - 1) m 1 2 answer += (n * (n - 1))/2 answer (n * (n - 1))/2 (n * (n - 1)) n (n - 1) n 1 2 System.out.println(answer) System.out.println System.out System System.out answer input.close() input.close input String [] commandLineArgument commandLineArgument public class Main {

    public static void main(String [] commandLineArgument){

        Scanner input = new Scanner(System.in);
        int n = input.nextInt() , m = input.nextInt();
        int answer = (m * (m - 1))/2;
        answer += (n * (n - 1))/2;
        System.out.println(answer);
        input.close();

    }

} public class Main {

    public static void main(String [] commandLineArgument){

        Scanner input = new Scanner(System.in);
        int n = input.nextInt() , m = input.nextInt();
        int answer = (m * (m - 1))/2;
        answer += (n * (n - 1))/2;
        System.out.println(answer);
        input.close();

    }

} Main
import java.util.*;

public class Main {

    public static void main(String [] commandLineArgument){

        Scanner input = new Scanner(System.in);
        int n = input.nextInt() , m = input.nextInt();
        int answer = (m * (m - 1))/2;
        answer += (n * (n - 1))/2;
        System.out.println(answer);
        input.close();

    }

}

