import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	int M = sc.nextInt();
    	sc.close();
    	int ans = 0;
    	int t1 = calcNumOfCombination(N, 2);
    	int t2 = calcNumOfCombination(M, 2);
    	ans = t1 + t2;
    	System.out.println(ans);
    }

	static int calcNumOfCombination(int n, int r){
	    int num = 1;
	    for(int i = 1; i <= r; i++){
	        num = num * (n - i + 1) / i;
	    }
	    return num;
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	int M = sc.nextInt();
    	sc.close();
    	int ans = 0;
    	int t1 = calcNumOfCombination(N, 2);
    	int t2 = calcNumOfCombination(M, 2);
    	ans = t1 + t2;
    	System.out.println(ans);
    }

	static int calcNumOfCombination(int n, int r){
	    int num = 1;
	    for(int i = 1; i <= r; i++){
	        num = num * (n - i + 1) / i;
	    }
	    return num;
	}
} Main public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	int M = sc.nextInt();
    	sc.close();
    	int ans = 0;
    	int t1 = calcNumOfCombination(N, 2);
    	int t2 = calcNumOfCombination(M, 2);
    	ans = t1 + t2;
    	System.out.println(ans);
    } main {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	int M = sc.nextInt();
    	sc.close();
    	int ans = 0;
    	int t1 = calcNumOfCombination(N, 2);
    	int t2 = calcNumOfCombination(M, 2);
    	ans = t1 + t2;
    	System.out.println(ans);
    } 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 sc.close() sc.close sc int ans = 0; ans 0 int t1 = calcNumOfCombination(N, 2); t1 calcNumOfCombination(N, 2) calcNumOfCombination N 2 int t2 = calcNumOfCombination(M, 2); t2 calcNumOfCombination(M, 2) calcNumOfCombination M 2 ans = t1 + t2 ans t1 + t2 t1 t2 System.out.println(ans) System.out.println System.out System System.out ans String[] args args static int calcNumOfCombination(int n, int r){
	    int num = 1;
	    for(int i = 1; i <= r; i++){
	        num = num * (n - i + 1) / i;
	    }
	    return num;
	} calcNumOfCombination {
	    int num = 1;
	    for(int i = 1; i <= r; i++){
	        num = num * (n - i + 1) / i;
	    }
	    return num;
	} int num = 1; num 1 for(int i = 1; i <= r; i++){
	        num = num * (n - i + 1) / i;
	    } int i = 1; int i = 1; i 1 i <= r i r i++ i++ i {
	        num = num * (n - i + 1) / i;
	    } {
	        num = num * (n - i + 1) / i;
	    } num = num * (n - i + 1) / i num num * (n - i + 1) / i num * (n - i + 1) num (n - i + 1) n - i n i 1 i return num; num int n n int r r public class Main {

	public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	int M = sc.nextInt();
    	sc.close();
    	int ans = 0;
    	int t1 = calcNumOfCombination(N, 2);
    	int t2 = calcNumOfCombination(M, 2);
    	ans = t1 + t2;
    	System.out.println(ans);
    }

	static int calcNumOfCombination(int n, int r){
	    int num = 1;
	    for(int i = 1; i <= r; i++){
	        num = num * (n - i + 1) / i;
	    }
	    return num;
	}
} public class Main {

	public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	int M = sc.nextInt();
    	sc.close();
    	int ans = 0;
    	int t1 = calcNumOfCombination(N, 2);
    	int t2 = calcNumOfCombination(M, 2);
    	ans = t1 + t2;
    	System.out.println(ans);
    }

	static int calcNumOfCombination(int n, int r){
	    int num = 1;
	    for(int i = 1; i <= r; i++){
	        num = num * (n - i + 1) / i;
	    }
	    return num;
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	int M = sc.nextInt();
    	sc.close();
    	int ans = 0;
    	int t1 = calcNumOfCombination(N, 2);
    	int t2 = calcNumOfCombination(M, 2);
    	ans = t1 + t2;
    	System.out.println(ans);
    }

	static int calcNumOfCombination(int n, int r){
	    int num = 1;
	    for(int i = 1; i <= r; i++){
	        num = num * (n - i + 1) / i;
	    }
	    return num;
	}
}