import java.util.Scanner;

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

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