import java.io.*;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner inputs = new Scanner(System.in);
		int N = inputs.nextInt();
		int M = inputs.nextInt();
		int sum = 0;
		if(N>=2) {
			sum+=comb(N,2);
		}
		if(M>=2) {
			sum+=comb(M,2);
		}
		System.out.println(sum);
	}
	static int comb(int n , int r)
	{
		if( r== 0 || n == r)
			return 1;
		else
			return comb(n-1,r)+comb(n-1,r-1);
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner inputs = new Scanner(System.in);
		int N = inputs.nextInt();
		int M = inputs.nextInt();
		int sum = 0;
		if(N>=2) {
			sum+=comb(N,2);
		}
		if(M>=2) {
			sum+=comb(M,2);
		}
		System.out.println(sum);
	}
	static int comb(int n , int r)
	{
		if( r== 0 || n == r)
			return 1;
		else
			return comb(n-1,r)+comb(n-1,r-1);
	}
} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner inputs = new Scanner(System.in);
		int N = inputs.nextInt();
		int M = inputs.nextInt();
		int sum = 0;
		if(N>=2) {
			sum+=comb(N,2);
		}
		if(M>=2) {
			sum+=comb(M,2);
		}
		System.out.println(sum);
	} main {
		// TODO Auto-generated method stub
		Scanner inputs = new Scanner(System.in);
		int N = inputs.nextInt();
		int M = inputs.nextInt();
		int sum = 0;
		if(N>=2) {
			sum+=comb(N,2);
		}
		if(M>=2) {
			sum+=comb(M,2);
		}
		System.out.println(sum);
	} Scanner inputs = new Scanner(System.in); inputs new Scanner(System.in) int N = inputs.nextInt(); N inputs.nextInt() inputs.nextInt inputs int M = inputs.nextInt(); M inputs.nextInt() inputs.nextInt inputs int sum = 0; sum 0 if(N>=2) {
			sum+=comb(N,2);
		} N>=2 N 2 {
			sum+=comb(N,2);
		} sum+=comb(N,2) sum comb(N,2) comb N 2 if(M>=2) {
			sum+=comb(M,2);
		} M>=2 M 2 {
			sum+=comb(M,2);
		} sum+=comb(M,2) sum comb(M,2) comb M 2 System.out.println(sum) System.out.println System.out System System.out sum String[] args args static int comb(int n , int r)
	{
		if( r== 0 || n == r)
			return 1;
		else
			return comb(n-1,r)+comb(n-1,r-1);
	} comb {
		if( r== 0 || n == r)
			return 1;
		else
			return comb(n-1,r)+comb(n-1,r-1);
	} if( r== 0 || n == r)
			return 1;
		else
			return comb(n-1,r)+comb(n-1,r-1); r== 0 || n == r r== 0 r 0 n == r n r return 1; 1 return comb(n-1,r)+comb(n-1,r-1); comb(n-1,r)+comb(n-1,r-1) comb(n-1,r) comb n-1 n 1 r comb(n-1,r-1) comb n-1 n 1 r-1 r 1 int n n int r r public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner inputs = new Scanner(System.in);
		int N = inputs.nextInt();
		int M = inputs.nextInt();
		int sum = 0;
		if(N>=2) {
			sum+=comb(N,2);
		}
		if(M>=2) {
			sum+=comb(M,2);
		}
		System.out.println(sum);
	}
	static int comb(int n , int r)
	{
		if( r== 0 || n == r)
			return 1;
		else
			return comb(n-1,r)+comb(n-1,r-1);
	}
} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner inputs = new Scanner(System.in);
		int N = inputs.nextInt();
		int M = inputs.nextInt();
		int sum = 0;
		if(N>=2) {
			sum+=comb(N,2);
		}
		if(M>=2) {
			sum+=comb(M,2);
		}
		System.out.println(sum);
	}
	static int comb(int n , int r)
	{
		if( r== 0 || n == r)
			return 1;
		else
			return comb(n-1,r)+comb(n-1,r-1);
	}
} Main
import java.io.*;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner inputs = new Scanner(System.in);
		int N = inputs.nextInt();
		int M = inputs.nextInt();
		int sum = 0;
		if(N>=2) {
			sum+=comb(N,2);
		}
		if(M>=2) {
			sum+=comb(M,2);
		}
		System.out.println(sum);
	}
	static int comb(int n , int r)
	{
		if( r== 0 || n == r)
			return 1;
		else
			return comb(n-1,r)+comb(n-1,r-1);
	}
}
