import java.util.*;

class Main {
  	public static void main (String[] args) throws java.lang.Exception {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
      	int M = scanner.nextInt();
      	int nPlusMChoose2 = (N+M) * (N+M-1) / 2;
		int oddCombos = N * M;
	    int result = nPlusMChoose2 - oddCombos;
		System.out.printf("%d\n", result);
    }
} import java.util.*; util.* java class Main {
  	public static void main (String[] args) throws java.lang.Exception {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
      	int M = scanner.nextInt();
      	int nPlusMChoose2 = (N+M) * (N+M-1) / 2;
		int oddCombos = N * M;
	    int result = nPlusMChoose2 - oddCombos;
		System.out.printf("%d\n", result);
    }
} Main public static void main (String[] args) throws java.lang.Exception {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
      	int M = scanner.nextInt();
      	int nPlusMChoose2 = (N+M) * (N+M-1) / 2;
		int oddCombos = N * M;
	    int result = nPlusMChoose2 - oddCombos;
		System.out.printf("%d\n", result);
    } main {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
      	int M = scanner.nextInt();
      	int nPlusMChoose2 = (N+M) * (N+M-1) / 2;
		int oddCombos = N * M;
	    int result = nPlusMChoose2 - oddCombos;
		System.out.printf("%d\n", result);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int M = scanner.nextInt(); M scanner.nextInt() scanner.nextInt scanner int nPlusMChoose2 = (N+M) * (N+M-1) / 2; nPlusMChoose2 (N+M) * (N+M-1) / 2 (N+M) * (N+M-1) (N+M) N M (N+M-1) N+M N M 1 2 int oddCombos = N * M; oddCombos N * M N M int result = nPlusMChoose2 - oddCombos; result nPlusMChoose2 - oddCombos nPlusMChoose2 oddCombos System.out.printf("%d\n", result) System.out.printf System.out System System.out "%d\n" result String[] args args
import java.util.*;

class Main {
  	public static void main (String[] args) throws java.lang.Exception {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
      	int M = scanner.nextInt();
      	int nPlusMChoose2 = (N+M) * (N+M-1) / 2;
		int oddCombos = N * M;
	    int result = nPlusMChoose2 - oddCombos;
		System.out.printf("%d\n", result);
    }
}