import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int X = sc.nextInt();
    int Y = sc.nextInt();
    int cnt = X*(X-1)/2+Y*(Y-1)/2;
    System.out.println(cnt);
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int X = sc.nextInt();
    int Y = sc.nextInt();
    int cnt = X*(X-1)/2+Y*(Y-1)/2;
    System.out.println(cnt);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int X = sc.nextInt();
    int Y = sc.nextInt();
    int cnt = X*(X-1)/2+Y*(Y-1)/2;
    System.out.println(cnt);
  } main {
    Scanner sc = new Scanner(System.in);
    int X = sc.nextInt();
    int Y = sc.nextInt();
    int cnt = X*(X-1)/2+Y*(Y-1)/2;
    System.out.println(cnt);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int Y = sc.nextInt(); Y sc.nextInt() sc.nextInt sc int cnt = X*(X-1)/2+Y*(Y-1)/2; cnt X*(X-1)/2+Y*(Y-1)/2 X*(X-1)/2 X*(X-1) X (X-1) X 1 2 Y*(Y-1)/2 Y*(Y-1) Y (Y-1) Y 1 2 System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args
import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int X = sc.nextInt();
    int Y = sc.nextInt();
    int cnt = X*(X-1)/2+Y*(Y-1)/2;
    System.out.println(cnt);
  }
}
