import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();

    int c = a*(a-1)/2;
    int d = b*(b-1)/2;

    System.out.println(c+d);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();

    int c = a*(a-1)/2;
    int d = b*(b-1)/2;

    System.out.println(c+d);
  }
} Main public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();

    int c = a*(a-1)/2;
    int d = b*(b-1)/2;

    System.out.println(c+d);
  } main {
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();

    int c = a*(a-1)/2;
    int d = b*(b-1)/2;

    System.out.println(c+d);
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int c = a*(a-1)/2; c a*(a-1)/2 a*(a-1) a (a-1) a 1 2 int d = b*(b-1)/2; d b*(b-1)/2 b*(b-1) b (b-1) b 1 2 System.out.println(c+d) System.out.println System.out System System.out c+d c d String[] args args public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();

    int c = a*(a-1)/2;
    int d = b*(b-1)/2;

    System.out.println(c+d);
  }
} public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();

    int c = a*(a-1)/2;
    int d = b*(b-1)/2;

    System.out.println(c+d);
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();

    int c = a*(a-1)/2;
    int d = b*(b-1)/2;

    System.out.println(c+d);
  }
}
