import java.util.Scanner;

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

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