import java.util.*;
import java.io.*;
public class Main {
  public static void main(String[] args) throws Exception {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int resultEven =0;
    int resultOdd=0;
    if(N>1){
      resultEven=nCr(N,2);
    }
    if(M>1){
      resultOdd=nCr(M,2);
    }
    
    int result=resultEven+resultOdd;
    
    
    System.out.println(result);
  }
  static int nCr(int n, int r) 
{ 
    return (n*(n-1))/2;
} 
  
// Returns factorial of n 
 
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
  public static void main(String[] args) throws Exception {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int resultEven =0;
    int resultOdd=0;
    if(N>1){
      resultEven=nCr(N,2);
    }
    if(M>1){
      resultOdd=nCr(M,2);
    }
    
    int result=resultEven+resultOdd;
    
    
    System.out.println(result);
  }
  static int nCr(int n, int r) 
{ 
    return (n*(n-1))/2;
} 
  
// Returns factorial of n 
 
} Main public static void main(String[] args) throws Exception {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int resultEven =0;
    int resultOdd=0;
    if(N>1){
      resultEven=nCr(N,2);
    }
    if(M>1){
      resultOdd=nCr(M,2);
    }
    
    int result=resultEven+resultOdd;
    
    
    System.out.println(result);
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int resultEven =0;
    int resultOdd=0;
    if(N>1){
      resultEven=nCr(N,2);
    }
    if(M>1){
      resultOdd=nCr(M,2);
    }
    
    int result=resultEven+resultOdd;
    
    
    System.out.println(result);
  } 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 int resultEven =0; resultEven 0 int resultOdd=0; resultOdd 0 if(N>1){
      resultEven=nCr(N,2);
    } N>1 N 1 {
      resultEven=nCr(N,2);
    } resultEven=nCr(N,2) resultEven nCr(N,2) nCr N 2 if(M>1){
      resultOdd=nCr(M,2);
    } M>1 M 1 {
      resultOdd=nCr(M,2);
    } resultOdd=nCr(M,2) resultOdd nCr(M,2) nCr M 2 int result=resultEven+resultOdd; result resultEven+resultOdd resultEven resultOdd System.out.println(result) System.out.println System.out System System.out result String[] args args static int nCr(int n, int r) 
{ 
    return (n*(n-1))/2;
} nCr { 
    return (n*(n-1))/2;
} return (n*(n-1))/2; (n*(n-1))/2 (n*(n-1)) n (n-1) n 1 2 int n n int r r public class Main {
  public static void main(String[] args) throws Exception {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int resultEven =0;
    int resultOdd=0;
    if(N>1){
      resultEven=nCr(N,2);
    }
    if(M>1){
      resultOdd=nCr(M,2);
    }
    
    int result=resultEven+resultOdd;
    
    
    System.out.println(result);
  }
  static int nCr(int n, int r) 
{ 
    return (n*(n-1))/2;
} 
  
// Returns factorial of n 
 
} public class Main {
  public static void main(String[] args) throws Exception {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int resultEven =0;
    int resultOdd=0;
    if(N>1){
      resultEven=nCr(N,2);
    }
    if(M>1){
      resultOdd=nCr(M,2);
    }
    
    int result=resultEven+resultOdd;
    
    
    System.out.println(result);
  }
  static int nCr(int n, int r) 
{ 
    return (n*(n-1))/2;
} 
  
// Returns factorial of n 
 
} Main
import java.util.*;
import java.io.*;
public class Main {
  public static void main(String[] args) throws Exception {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int resultEven =0;
    int resultOdd=0;
    if(N>1){
      resultEven=nCr(N,2);
    }
    if(M>1){
      resultOdd=nCr(M,2);
    }
    
    int result=resultEven+resultOdd;
    
    
    System.out.println(result);
  }
  static int nCr(int n, int r) 
{ 
    return (n*(n-1))/2;
} 
  
// Returns factorial of n 
 
}
