
import java.util.Scanner;
public class Main {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int M=sc.nextInt();
		System.out.println(calcNumOfCombination(N, 2)+calcNumOfCombination(M, 2));

		}
	 public 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 {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int M=sc.nextInt();
		System.out.println(calcNumOfCombination(N, 2)+calcNumOfCombination(M, 2));

		}
	 public 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 @SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int M=sc.nextInt();
		System.out.println(calcNumOfCombination(N, 2)+calcNumOfCombination(M, 2));

		} main {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int M=sc.nextInt();
		System.out.println(calcNumOfCombination(N, 2)+calcNumOfCombination(M, 2));

		} 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 System.out.println(calcNumOfCombination(N, 2)+calcNumOfCombination(M, 2)) System.out.println System.out System System.out calcNumOfCombination(N, 2)+calcNumOfCombination(M, 2) calcNumOfCombination(N, 2) calcNumOfCombination N 2 calcNumOfCombination(M, 2) calcNumOfCombination M 2 String[] args args public 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 {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int M=sc.nextInt();
		System.out.println(calcNumOfCombination(N, 2)+calcNumOfCombination(M, 2));

		}
	 public 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 {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int M=sc.nextInt();
		System.out.println(calcNumOfCombination(N, 2)+calcNumOfCombination(M, 2));

		}
	 public 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 {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int M=sc.nextInt();
		System.out.println(calcNumOfCombination(N, 2)+calcNumOfCombination(M, 2));

		}
	 public 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;
	    }
}
