import java.util.*;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        
        int num1 = sc.nextInt();
        int num2 = sc.nextInt();
        
        int even = num1 * (num1 - 1) / 2;
        int odd = num2 * (num2 -1) / 2;
      
        // System.out.println(even);
        // System.out.println(odd);
        
        System.out.println(even + odd);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        
        int num1 = sc.nextInt();
        int num2 = sc.nextInt();
        
        int even = num1 * (num1 - 1) / 2;
        int odd = num2 * (num2 -1) / 2;
      
        // System.out.println(even);
        // System.out.println(odd);
        
        System.out.println(even + odd);
    }
} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        
        int num1 = sc.nextInt();
        int num2 = sc.nextInt();
        
        int even = num1 * (num1 - 1) / 2;
        int odd = num2 * (num2 -1) / 2;
      
        // System.out.println(even);
        // System.out.println(odd);
        
        System.out.println(even + odd);
    } main {
        Scanner sc = new Scanner(System.in);
        
        int num1 = sc.nextInt();
        int num2 = sc.nextInt();
        
        int even = num1 * (num1 - 1) / 2;
        int odd = num2 * (num2 -1) / 2;
      
        // System.out.println(even);
        // System.out.println(odd);
        
        System.out.println(even + odd);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num1 = sc.nextInt(); num1 sc.nextInt() sc.nextInt sc int num2 = sc.nextInt(); num2 sc.nextInt() sc.nextInt sc int even = num1 * (num1 - 1) / 2; even num1 * (num1 - 1) / 2 num1 * (num1 - 1) num1 (num1 - 1) num1 1 2 int odd = num2 * (num2 -1) / 2; odd num2 * (num2 -1) / 2 num2 * (num2 -1) num2 (num2 -1) num2 1 2 System.out.println(even + odd) System.out.println System.out System System.out even + odd even odd String args[] args public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        
        int num1 = sc.nextInt();
        int num2 = sc.nextInt();
        
        int even = num1 * (num1 - 1) / 2;
        int odd = num2 * (num2 -1) / 2;
      
        // System.out.println(even);
        // System.out.println(odd);
        
        System.out.println(even + odd);
    }
} public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        
        int num1 = sc.nextInt();
        int num2 = sc.nextInt();
        
        int even = num1 * (num1 - 1) / 2;
        int odd = num2 * (num2 -1) / 2;
      
        // System.out.println(even);
        // System.out.println(odd);
        
        System.out.println(even + odd);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        
        int num1 = sc.nextInt();
        int num2 = sc.nextInt();
        
        int even = num1 * (num1 - 1) / 2;
        int odd = num2 * (num2 -1) / 2;
      
        // System.out.println(even);
        // System.out.println(odd);
        
        System.out.println(even + odd);
    }
}