import java.io.*;

public class Main {

  public static void main(String[] args) throws IOException {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    String[] in;
    in = br.readLine().split(" ");
    int n = Integer.parseInt(in[0]);
    int m = Integer.parseInt(in[1]);

    br.close();

    System.out.println((n * (n-1) + m * (m-1)) / 2);
    
  }
} import java.io.*; io.* java public class Main {

  public static void main(String[] args) throws IOException {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    String[] in;
    in = br.readLine().split(" ");
    int n = Integer.parseInt(in[0]);
    int m = Integer.parseInt(in[1]);

    br.close();

    System.out.println((n * (n-1) + m * (m-1)) / 2);
    
  }
} Main public static void main(String[] args) throws IOException {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    String[] in;
    in = br.readLine().split(" ");
    int n = Integer.parseInt(in[0]);
    int m = Integer.parseInt(in[1]);

    br.close();

    System.out.println((n * (n-1) + m * (m-1)) / 2);
    
  } main {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    String[] in;
    in = br.readLine().split(" ");
    int n = Integer.parseInt(in[0]);
    int m = Integer.parseInt(in[1]);

    br.close();

    System.out.println((n * (n-1) + m * (m-1)) / 2);
    
  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] in; in in = br.readLine().split(" ") in br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int n = Integer.parseInt(in[0]); n Integer.parseInt(in[0]) Integer.parseInt Integer in[0] in 0 int m = Integer.parseInt(in[1]); m Integer.parseInt(in[1]) Integer.parseInt Integer in[1] in 1 br.close() br.close br System.out.println((n * (n-1) + m * (m-1)) / 2) System.out.println System.out System System.out (n * (n-1) + m * (m-1)) / 2 (n * (n-1) + m * (m-1)) n * (n-1) n (n-1) n 1 m * (m-1) m (m-1) m 1 2 String[] args args public class Main {

  public static void main(String[] args) throws IOException {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    String[] in;
    in = br.readLine().split(" ");
    int n = Integer.parseInt(in[0]);
    int m = Integer.parseInt(in[1]);

    br.close();

    System.out.println((n * (n-1) + m * (m-1)) / 2);
    
  }
} public class Main {

  public static void main(String[] args) throws IOException {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    String[] in;
    in = br.readLine().split(" ");
    int n = Integer.parseInt(in[0]);
    int m = Integer.parseInt(in[1]);

    br.close();

    System.out.println((n * (n-1) + m * (m-1)) / 2);
    
  }
} Main
import java.io.*;

public class Main {

  public static void main(String[] args) throws IOException {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    String[] in;
    in = br.readLine().split(" ");
    int n = Integer.parseInt(in[0]);
    int m = Integer.parseInt(in[1]);

    br.close();

    System.out.println((n * (n-1) + m * (m-1)) / 2);
    
  }
}