import java.util.Scanner;
 
public class Main {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        int S = N*(N-1)/2+M*(M-1)/2;
        System.out.print(S);
    }
 
} 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();
        int M = in.nextInt();
        int S = N*(N-1)/2+M*(M-1)/2;
        System.out.print(S);
    }
 
} Main public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        int S = N*(N-1)/2+M*(M-1)/2;
        System.out.print(S);
    } main {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        int S = N*(N-1)/2+M*(M-1)/2;
        System.out.print(S);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int M = in.nextInt(); M in.nextInt() in.nextInt in int S = N*(N-1)/2+M*(M-1)/2; S 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 System.out.print(S) System.out.print System.out System System.out S String[] args args public class Main {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        int S = N*(N-1)/2+M*(M-1)/2;
        System.out.print(S);
    }
 
} public class Main {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        int S = N*(N-1)/2+M*(M-1)/2;
        System.out.print(S);
    }
 
} Main
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        int S = N*(N-1)/2+M*(M-1)/2;
        System.out.print(S);
    }
 
}