import java.util.*;
import java.io.*;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		
		long n  =sc.nextLong();
		long m = sc.nextLong();
		long a1 = ((n)*(n-1))/2;
		long a2 = ((m)*(m-1))/2;
		System.out.println(a1+a2);
	}
} import java.util.*; util.* java import java.io.*; io.* java class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		
		long n  =sc.nextLong();
		long m = sc.nextLong();
		long a1 = ((n)*(n-1))/2;
		long a2 = ((m)*(m-1))/2;
		System.out.println(a1+a2);
	}
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		
		long n  =sc.nextLong();
		long m = sc.nextLong();
		long a1 = ((n)*(n-1))/2;
		long a2 = ((m)*(m-1))/2;
		System.out.println(a1+a2);
	} main {
    Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		
		long n  =sc.nextLong();
		long m = sc.nextLong();
		long a1 = ((n)*(n-1))/2;
		long a2 = ((m)*(m-1))/2;
		System.out.println(a1+a2);
	} Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in))); sc new Scanner(new BufferedReader(new InputStreamReader(System.in))) long n  =sc.nextLong(); n sc.nextLong() sc.nextLong sc long m = sc.nextLong(); m sc.nextLong() sc.nextLong sc long a1 = ((n)*(n-1))/2; a1 ((n)*(n-1))/2 ((n)*(n-1)) (n) (n-1) n 1 2 long a2 = ((m)*(m-1))/2; a2 ((m)*(m-1))/2 ((m)*(m-1)) (m) (m-1) m 1 2 System.out.println(a1+a2) System.out.println System.out System System.out a1+a2 a1 a2 String[] args args
import java.util.*;
import java.io.*;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		
		long n  =sc.nextLong();
		long m = sc.nextLong();
		long a1 = ((n)*(n-1))/2;
		long a2 = ((m)*(m-1))/2;
		System.out.println(a1+a2);
	}
}