import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		
		 int N = sc.nextInt();
		 int M = sc.nextInt();
		
		 int b = N*(N-1)/2;
		 int c = M*(M-1)/2;
		 
		 int sum = b+ c;
		 System.out.println(sum);
	}
} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		
		 int N = sc.nextInt();
		 int M = sc.nextInt();
		
		 int b = N*(N-1)/2;
		 int c = M*(M-1)/2;
		 
		 int sum = b+ c;
		 System.out.println(sum);
	}
} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		
		 int N = sc.nextInt();
		 int M = sc.nextInt();
		
		 int b = N*(N-1)/2;
		 int c = M*(M-1)/2;
		 
		 int sum = b+ c;
		 System.out.println(sum);
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		
		 int N = sc.nextInt();
		 int M = sc.nextInt();
		
		 int b = N*(N-1)/2;
		 int c = M*(M-1)/2;
		 
		 int sum = b+ c;
		 System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int M = sc.nextInt(); M sc.nextInt() sc.nextInt sc int b = N*(N-1)/2; b N*(N-1)/2 N*(N-1) N (N-1) N 1 2 int c = M*(M-1)/2; c M*(M-1)/2 M*(M-1) M (M-1) M 1 2 int sum = b+ c; sum b+ c b c System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		
		 int N = sc.nextInt();
		 int M = sc.nextInt();
		
		 int b = N*(N-1)/2;
		 int c = M*(M-1)/2;
		 
		 int sum = b+ c;
		 System.out.println(sum);
	}
} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		
		 int N = sc.nextInt();
		 int M = sc.nextInt();
		
		 int b = N*(N-1)/2;
		 int c = M*(M-1)/2;
		 
		 int sum = b+ c;
		 System.out.println(sum);
	}
} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		
		 int N = sc.nextInt();
		 int M = sc.nextInt();
		
		 int b = N*(N-1)/2;
		 int c = M*(M-1)/2;
		 
		 int sum = b+ c;
		 System.out.println(sum);
	}
}