import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner in =new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        long sum = 0;
        sum=1;
        sum*=N;
        sum*=(N-1);
        sum/=2;
        int sumM =1;
        sumM*=(M-1);
        sumM*=M;
        sumM/=2;
        System.out.println(sum+sumM);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner in =new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        long sum = 0;
        sum=1;
        sum*=N;
        sum*=(N-1);
        sum/=2;
        int sumM =1;
        sumM*=(M-1);
        sumM*=M;
        sumM/=2;
        System.out.println(sum+sumM);
    }
} Main public static void main(String[] args) {
	// write your code here
        Scanner in =new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        long sum = 0;
        sum=1;
        sum*=N;
        sum*=(N-1);
        sum/=2;
        int sumM =1;
        sumM*=(M-1);
        sumM*=M;
        sumM/=2;
        System.out.println(sum+sumM);
    } main {
	// write your code here
        Scanner in =new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        long sum = 0;
        sum=1;
        sum*=N;
        sum*=(N-1);
        sum/=2;
        int sumM =1;
        sumM*=(M-1);
        sumM*=M;
        sumM/=2;
        System.out.println(sum+sumM);
    } Scanner in =new Scanner(System.in); in new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int M = in.nextInt(); M in.nextInt() in.nextInt in long sum = 0; sum 0 sum=1 sum 1 sum*=N sum N sum*=(N-1) sum (N-1) N 1 sum/=2 sum 2 int sumM =1; sumM 1 sumM*=(M-1) sumM (M-1) M 1 sumM*=M sumM M sumM/=2 sumM 2 System.out.println(sum+sumM) System.out.println System.out System System.out sum+sumM sum sumM String[] args args public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner in =new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        long sum = 0;
        sum=1;
        sum*=N;
        sum*=(N-1);
        sum/=2;
        int sumM =1;
        sumM*=(M-1);
        sumM*=M;
        sumM/=2;
        System.out.println(sum+sumM);
    }
} public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner in =new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        long sum = 0;
        sum=1;
        sum*=N;
        sum*=(N-1);
        sum/=2;
        int sumM =1;
        sumM*=(M-1);
        sumM*=M;
        sumM/=2;
        System.out.println(sum+sumM);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner in =new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        long sum = 0;
        sum=1;
        sum*=N;
        sum*=(N-1);
        sum/=2;
        int sumM =1;
        sumM*=(M-1);
        sumM*=M;
        sumM/=2;
        System.out.println(sum+sumM);
    }
}
