import java.util.*;

public class Main {
    static int xC2(int x){
        int A;
        if(x>1)
            A= x*(x-1)/2;
        else
            A = 0;
        
        return A;
        }
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int M = stdIn.nextInt();

        int E = 0;
        E = xC2(N) + xC2(M);

        System.out.print(E);



    }
} import java.util.*; util.* java public class Main {
    static int xC2(int x){
        int A;
        if(x>1)
            A= x*(x-1)/2;
        else
            A = 0;
        
        return A;
        }
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int M = stdIn.nextInt();

        int E = 0;
        E = xC2(N) + xC2(M);

        System.out.print(E);



    }
} Main static int xC2(int x){
        int A;
        if(x>1)
            A= x*(x-1)/2;
        else
            A = 0;
        
        return A;
        } xC2 {
        int A;
        if(x>1)
            A= x*(x-1)/2;
        else
            A = 0;
        
        return A;
        } int A; A if(x>1)
            A= x*(x-1)/2;
        else
            A = 0; x>1 x 1 A= x*(x-1)/2 A x*(x-1)/2 x*(x-1) x (x-1) x 1 2 A = 0 A 0 return A; A int x x public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int M = stdIn.nextInt();

        int E = 0;
        E = xC2(N) + xC2(M);

        System.out.print(E);



    } main {
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int M = stdIn.nextInt();

        int E = 0;
        E = xC2(N) + xC2(M);

        System.out.print(E);



    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int N = stdIn.nextInt(); N stdIn.nextInt() stdIn.nextInt stdIn int M = stdIn.nextInt(); M stdIn.nextInt() stdIn.nextInt stdIn int E = 0; E 0 E = xC2(N) + xC2(M) E xC2(N) + xC2(M) xC2(N) xC2 N xC2(M) xC2 M System.out.print(E) System.out.print System.out System System.out E String[] args args public class Main {
    static int xC2(int x){
        int A;
        if(x>1)
            A= x*(x-1)/2;
        else
            A = 0;
        
        return A;
        }
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int M = stdIn.nextInt();

        int E = 0;
        E = xC2(N) + xC2(M);

        System.out.print(E);



    }
} public class Main {
    static int xC2(int x){
        int A;
        if(x>1)
            A= x*(x-1)/2;
        else
            A = 0;
        
        return A;
        }
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int M = stdIn.nextInt();

        int E = 0;
        E = xC2(N) + xC2(M);

        System.out.print(E);



    }
} Main
import java.util.*;

public class Main {
    static int xC2(int x){
        int A;
        if(x>1)
            A= x*(x-1)/2;
        else
            A = 0;
        
        return A;
        }
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int M = stdIn.nextInt();

        int E = 0;
        E = xC2(N) + xC2(M);

        System.out.print(E);



    }
}