import java.util.Scanner;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {

        Scanner scan = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        
		String[] str = scan.nextLine().split(" ");
		int[] x = new int[str.length];
		
        for(int i = 0; i < str.length; i++){
            x[i] = Integer.parseInt(str[i]);
        }
        
        out.println((x[0] * (x[0] - 1) / 2) + (x[1] * (x[1] - 1) / 2));
        
        out.close();
        
    }
} import java.util.Scanner; Scanner java.util import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws Exception {

        Scanner scan = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        
		String[] str = scan.nextLine().split(" ");
		int[] x = new int[str.length];
		
        for(int i = 0; i < str.length; i++){
            x[i] = Integer.parseInt(str[i]);
        }
        
        out.println((x[0] * (x[0] - 1) / 2) + (x[1] * (x[1] - 1) / 2));
        
        out.close();
        
    }
} Main public static void main(String[] args) throws Exception {

        Scanner scan = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        
		String[] str = scan.nextLine().split(" ");
		int[] x = new int[str.length];
		
        for(int i = 0; i < str.length; i++){
            x[i] = Integer.parseInt(str[i]);
        }
        
        out.println((x[0] * (x[0] - 1) / 2) + (x[1] * (x[1] - 1) / 2));
        
        out.close();
        
    } main {

        Scanner scan = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        
		String[] str = scan.nextLine().split(" ");
		int[] x = new int[str.length];
		
        for(int i = 0; i < str.length; i++){
            x[i] = Integer.parseInt(str[i]);
        }
        
        out.println((x[0] * (x[0] - 1) / 2) + (x[1] * (x[1] - 1) / 2));
        
        out.close();
        
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); out new PrintWriter(new OutputStreamWriter(System.out)) String[] str = scan.nextLine().split(" "); str scan.nextLine().split(" ") scan.nextLine().split scan.nextLine() scan.nextLine scan " " int[] x = new int[str.length]; x new int[str.length] str.length str str.length for(int i = 0; i < str.length; i++){
            x[i] = Integer.parseInt(str[i]);
        } int i = 0; int i = 0; i 0 i < str.length i str.length str str.length i++ i++ i {
            x[i] = Integer.parseInt(str[i]);
        } {
            x[i] = Integer.parseInt(str[i]);
        } x[i] = Integer.parseInt(str[i]) x[i] x i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i out.println((x[0] * (x[0] - 1) / 2) + (x[1] * (x[1] - 1) / 2)) out.println out (x[0] * (x[0] - 1) / 2) + (x[1] * (x[1] - 1) / 2) (x[0] * (x[0] - 1) / 2) x[0] * (x[0] - 1) x[0] x 0 (x[0] - 1) x[0] x 0 1 2 (x[1] * (x[1] - 1) / 2) x[1] * (x[1] - 1) x[1] x 1 (x[1] - 1) x[1] x 1 1 2 out.close() out.close out String[] args args public class Main {
    public static void main(String[] args) throws Exception {

        Scanner scan = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        
		String[] str = scan.nextLine().split(" ");
		int[] x = new int[str.length];
		
        for(int i = 0; i < str.length; i++){
            x[i] = Integer.parseInt(str[i]);
        }
        
        out.println((x[0] * (x[0] - 1) / 2) + (x[1] * (x[1] - 1) / 2));
        
        out.close();
        
    }
} public class Main {
    public static void main(String[] args) throws Exception {

        Scanner scan = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        
		String[] str = scan.nextLine().split(" ");
		int[] x = new int[str.length];
		
        for(int i = 0; i < str.length; i++){
            x[i] = Integer.parseInt(str[i]);
        }
        
        out.println((x[0] * (x[0] - 1) / 2) + (x[1] * (x[1] - 1) / 2));
        
        out.close();
        
    }
} Main
import java.util.Scanner;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {

        Scanner scan = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        
		String[] str = scan.nextLine().split(" ");
		int[] x = new int[str.length];
		
        for(int i = 0; i < str.length; i++){
            x[i] = Integer.parseInt(str[i]);
        }
        
        out.println((x[0] * (x[0] - 1) / 2) + (x[1] * (x[1] - 1) / 2));
        
        out.close();
        
    }
}