import java.util.*;
class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
	int M = stdIn.nextInt();
	int m=(M*(M-1))/2; //偶数を２つ選ぶ
	int n=(N*(N-1))/2; //奇数を２つ選ぶ
	System.out.println(m+n);
    }
}
	    
	     import java.util.*; util.* java class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
	int M = stdIn.nextInt();
	int m=(M*(M-1))/2; //偶数を２つ選ぶ
	int n=(N*(N-1))/2; //奇数を２つ選ぶ
	System.out.println(m+n);
    }
} Main public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
	int M = stdIn.nextInt();
	int m=(M*(M-1))/2; //偶数を２つ選ぶ
	int n=(N*(N-1))/2; //奇数を２つ選ぶ
	System.out.println(m+n);
    } main {
	Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
	int M = stdIn.nextInt();
	int m=(M*(M-1))/2; //偶数を２つ選ぶ
	int n=(N*(N-1))/2; //奇数を２つ選ぶ
	System.out.println(m+n);
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int N = stdIn.nextInt(); N stdIn.nextInt() stdIn.nextInt stdIn int M = stdIn.nextInt(); M stdIn.nextInt() stdIn.nextInt stdIn int m=(M*(M-1))/2; m (M*(M-1))/2 (M*(M-1)) M (M-1) M 1 2 int n=(N*(N-1))/2; n (N*(N-1))/2 (N*(N-1)) N (N-1) N 1 2 System.out.println(m+n) System.out.println System.out System System.out m+n m n String[] args args
import java.util.*;
class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
	int M = stdIn.nextInt();
	int m=(M*(M-1))/2; //偶数を２つ選ぶ
	int n=(N*(N-1))/2; //奇数を２つ選ぶ
	System.out.println(m+n);
    }
}
	    
	    
