import java.util.*;

class Main {

    static public int solve(int N, int M) {
        return M*(M-1)/2 + N*(N-1)/2;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();

        sc.close();

        System.out.println(solve(N, M));

    }
} import java.util.*; util.* java class Main {

    static public int solve(int N, int M) {
        return M*(M-1)/2 + N*(N-1)/2;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();

        sc.close();

        System.out.println(solve(N, M));

    }
} Main static public int solve(int N, int M) {
        return M*(M-1)/2 + N*(N-1)/2;
    } solve {
        return M*(M-1)/2 + N*(N-1)/2;
    } return M*(M-1)/2 + N*(N-1)/2; M*(M-1)/2 + N*(N-1)/2 M*(M-1)/2 M*(M-1) M (M-1) M 1 2 N*(N-1)/2 N*(N-1) N (N-1) N 1 2 int N N int M M public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();

        sc.close();

        System.out.println(solve(N, M));

    } main {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();

        sc.close();

        System.out.println(solve(N, M));

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int M = sc.nextInt(); M sc.nextInt() sc.nextInt sc sc.close() sc.close sc System.out.println(solve(N, M)) System.out.println System.out System System.out solve(N, M) solve N M String[] args args
import java.util.*;

class Main {

    static public int solve(int N, int M) {
        return M*(M-1)/2 + N*(N-1)/2;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();

        sc.close();

        System.out.println(solve(N, M));

    }
}