import java.util.*;


// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail

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

        // Write your code here

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

        // Write your code here

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

        // Write your code here

    } main {
       
        Scanner s = new Scanner(System.in);
        int n=s.nextInt();
      int m=s.nextInt();
      System.out.println((n*(n-1))/2+(m*(m-1))/2);
    

        // Write your code here

    } 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 System.out.println((n*(n-1))/2+(m*(m-1))/2) System.out.println System.out System System.out (n*(n-1))/2+(m*(m-1))/2 (n*(n-1))/2 (n*(n-1)) n (n-1) n 1 2 (m*(m-1))/2 (m*(m-1)) m (m-1) m 1 2 String args[] args
import java.util.*;


// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail

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

        // Write your code here

    }
}