import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int cnt = n + m;
    int total = 0;
    
    for(int i = 0; i < cnt; i++){
      total += i;
    }
    
    int odd = n * m;
    
    System.out.println(total - odd);
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int cnt = n + m;
    int total = 0;
    
    for(int i = 0; i < cnt; i++){
      total += i;
    }
    
    int odd = n * m;
    
    System.out.println(total - odd);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int cnt = n + m;
    int total = 0;
    
    for(int i = 0; i < cnt; i++){
      total += i;
    }
    
    int odd = n * m;
    
    System.out.println(total - odd);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int cnt = n + m;
    int total = 0;
    
    for(int i = 0; i < cnt; i++){
      total += i;
    }
    
    int odd = n * m;
    
    System.out.println(total - odd);
  } 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 cnt = n + m; cnt n + m n m int total = 0; total 0 for(int i = 0; i < cnt; i++){
      total += i;
    } int i = 0; int i = 0; i 0 i < cnt i cnt i++ i++ i {
      total += i;
    } {
      total += i;
    } total += i total i int odd = n * m; odd n * m n m System.out.println(total - odd) System.out.println System.out System System.out total - odd total odd String[] args args
import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int cnt = n + m;
    int total = 0;
    
    for(int i = 0; i < cnt; i++){
      total += i;
    }
    
    int odd = n * m;
    
    System.out.println(total - odd);
  }
}
