import java.util.*;
import java.io.*;

public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
	int M = in.nextInt();
    int NA = (N * (N - 1))/2, MA = (M * (M - 1))/2;
    System.out.println(NA + MA);
  }
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
	int M = in.nextInt();
    int NA = (N * (N - 1))/2, MA = (M * (M - 1))/2;
    System.out.println(NA + MA);
  }
} Main public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
	int M = in.nextInt();
    int NA = (N * (N - 1))/2, MA = (M * (M - 1))/2;
    System.out.println(NA + MA);
  } main {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
	int M = in.nextInt();
    int NA = (N * (N - 1))/2, MA = (M * (M - 1))/2;
    System.out.println(NA + MA);
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int M = in.nextInt(); M in.nextInt() in.nextInt in int NA = (N * (N - 1))/2 NA (N * (N - 1))/2 (N * (N - 1)) N (N - 1) N 1 2 MA = (M * (M - 1))/2; MA (M * (M - 1))/2 (M * (M - 1)) M (M - 1) M 1 2 System.out.println(NA + MA) System.out.println System.out System System.out NA + MA NA MA String[] args args public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
	int M = in.nextInt();
    int NA = (N * (N - 1))/2, MA = (M * (M - 1))/2;
    System.out.println(NA + MA);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
	int M = in.nextInt();
    int NA = (N * (N - 1))/2, MA = (M * (M - 1))/2;
    System.out.println(NA + MA);
  }
} Main
import java.util.*;
import java.io.*;

public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
	int M = in.nextInt();
    int NA = (N * (N - 1))/2, MA = (M * (M - 1))/2;
    System.out.println(NA + MA);
  }
}