import java.util.Scanner;
class Main{
	public static void main(String[] args){
    	Scanner console = new Scanner(System.in);
    	int N = console.nextInt();
      int M = console.nextInt();
      System.out.println(combination(N) + combination(M));
	}
	
	public static int combination(int num){
	   int comb = 0;
      int temp = 1;
      for(int i = num; i > num - 2; i--){
         temp *= i;
      }
      temp /= 2;
      if(temp != 0){
         comb = temp;
     	}
     	return comb;
	}
} import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args){
    	Scanner console = new Scanner(System.in);
    	int N = console.nextInt();
      int M = console.nextInt();
      System.out.println(combination(N) + combination(M));
	}
	
	public static int combination(int num){
	   int comb = 0;
      int temp = 1;
      for(int i = num; i > num - 2; i--){
         temp *= i;
      }
      temp /= 2;
      if(temp != 0){
         comb = temp;
     	}
     	return comb;
	}
} Main public static void main(String[] args){
    	Scanner console = new Scanner(System.in);
    	int N = console.nextInt();
      int M = console.nextInt();
      System.out.println(combination(N) + combination(M));
	} main {
    	Scanner console = new Scanner(System.in);
    	int N = console.nextInt();
      int M = console.nextInt();
      System.out.println(combination(N) + combination(M));
	} Scanner console = new Scanner(System.in); console new Scanner(System.in) int N = console.nextInt(); N console.nextInt() console.nextInt console int M = console.nextInt(); M console.nextInt() console.nextInt console System.out.println(combination(N) + combination(M)) System.out.println System.out System System.out combination(N) + combination(M) combination(N) combination N combination(M) combination M String[] args args public static int combination(int num){
	   int comb = 0;
      int temp = 1;
      for(int i = num; i > num - 2; i--){
         temp *= i;
      }
      temp /= 2;
      if(temp != 0){
         comb = temp;
     	}
     	return comb;
	} combination {
	   int comb = 0;
      int temp = 1;
      for(int i = num; i > num - 2; i--){
         temp *= i;
      }
      temp /= 2;
      if(temp != 0){
         comb = temp;
     	}
     	return comb;
	} int comb = 0; comb 0 int temp = 1; temp 1 for(int i = num; i > num - 2; i--){
         temp *= i;
      } int i = num; int i = num; i num i > num - 2 i num - 2 num 2 i-- i-- i {
         temp *= i;
      } {
         temp *= i;
      } temp *= i temp i temp /= 2 temp 2 if(temp != 0){
         comb = temp;
     	} temp != 0 temp 0 {
         comb = temp;
     	} comb = temp comb temp return comb; comb int num num
import java.util.Scanner;
class Main{
	public static void main(String[] args){
    	Scanner console = new Scanner(System.in);
    	int N = console.nextInt();
      int M = console.nextInt();
      System.out.println(combination(N) + combination(M));
	}
	
	public static int combination(int num){
	   int comb = 0;
      int temp = 1;
      for(int i = num; i > num - 2; i--){
         temp *= i;
      }
      temp /= 2;
      if(temp != 0){
         comb = temp;
     	}
     	return comb;
	}
}