import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
      Scanner in = new Scanner(System.in);
      int n = in.nextInt(), m = in.nextInt();
      int ans = (n*n-n+m*m-m)/2;
      System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]) {
      Scanner in = new Scanner(System.in);
      int n = in.nextInt(), m = in.nextInt();
      int ans = (n*n-n+m*m-m)/2;
      System.out.println(ans);
    }
} Main public static void main(String args[]) {
      Scanner in = new Scanner(System.in);
      int n = in.nextInt(), m = in.nextInt();
      int ans = (n*n-n+m*m-m)/2;
      System.out.println(ans);
    } main {
      Scanner in = new Scanner(System.in);
      int n = in.nextInt(), m = in.nextInt();
      int ans = (n*n-n+m*m-m)/2;
      System.out.println(ans);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt() n in.nextInt() in.nextInt in m = in.nextInt(); m in.nextInt() in.nextInt in int ans = (n*n-n+m*m-m)/2; ans (n*n-n+m*m-m)/2 (n*n-n+m*m-m) n*n-n+m*m n*n-n n*n n n n m*m m m m 2 System.out.println(ans) System.out.println System.out System System.out ans String args[] args public class Main {
    public static void main(String args[]) {
      Scanner in = new Scanner(System.in);
      int n = in.nextInt(), m = in.nextInt();
      int ans = (n*n-n+m*m-m)/2;
      System.out.println(ans);
    }
} public class Main {
    public static void main(String args[]) {
      Scanner in = new Scanner(System.in);
      int n = in.nextInt(), m = in.nextInt();
      int ans = (n*n-n+m*m-m)/2;
      System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
      Scanner in = new Scanner(System.in);
      int n = in.nextInt(), m = in.nextInt();
      int ans = (n*n-n+m*m-m)/2;
      System.out.println(ans);
    }
}