import java.io.*;

public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        String[] arr = reader.readLine().split (" ");
        double N, M;
        N = Double.parseDouble (arr[0]);
        M = Double.parseDouble (arr[1]);
        System.out.printf ("%.0f%n", Math.ceil (N * (N - 1) / 2) +
                                         Math.ceil (M * (M - 1) / 2));
    }
} import java.io.*; io.* java public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        String[] arr = reader.readLine().split (" ");
        double N, M;
        N = Double.parseDouble (arr[0]);
        M = Double.parseDouble (arr[1]);
        System.out.printf ("%.0f%n", Math.ceil (N * (N - 1) / 2) +
                                         Math.ceil (M * (M - 1) / 2));
    }
} Main public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        String[] arr = reader.readLine().split (" ");
        double N, M;
        N = Double.parseDouble (arr[0]);
        M = Double.parseDouble (arr[1]);
        System.out.printf ("%.0f%n", Math.ceil (N * (N - 1) / 2) +
                                         Math.ceil (M * (M - 1) / 2));
    } main {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        String[] arr = reader.readLine().split (" ");
        double N, M;
        N = Double.parseDouble (arr[0]);
        M = Double.parseDouble (arr[1]);
        System.out.printf ("%.0f%n", Math.ceil (N * (N - 1) / 2) +
                                         Math.ceil (M * (M - 1) / 2));
    } BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in)); reader new BufferedReader (new InputStreamReader (System.in)) String[] arr = reader.readLine().split (" "); arr reader.readLine().split (" ") reader.readLine().split reader.readLine() reader.readLine reader " " double N N M; M N = Double.parseDouble (arr[0]) N Double.parseDouble (arr[0]) Double.parseDouble Double arr[0] arr 0 M = Double.parseDouble (arr[1]) M Double.parseDouble (arr[1]) Double.parseDouble Double arr[1] arr 1 System.out.printf ("%.0f%n", Math.ceil (N * (N - 1) / 2) +
                                         Math.ceil (M * (M - 1) / 2)) System.out.printf System.out System System.out "%.0f%n" Math.ceil (N * (N - 1) / 2) +
                                         Math.ceil (M * (M - 1) / 2) Math.ceil (N * (N - 1) / 2) Math.ceil Math N * (N - 1) / 2 N * (N - 1) N (N - 1) N 1 2 Math.ceil (M * (M - 1) / 2) Math.ceil Math M * (M - 1) / 2 M * (M - 1) M (M - 1) M 1 2 String[] args args public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        String[] arr = reader.readLine().split (" ");
        double N, M;
        N = Double.parseDouble (arr[0]);
        M = Double.parseDouble (arr[1]);
        System.out.printf ("%.0f%n", Math.ceil (N * (N - 1) / 2) +
                                         Math.ceil (M * (M - 1) / 2));
    }
} public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        String[] arr = reader.readLine().split (" ");
        double N, M;
        N = Double.parseDouble (arr[0]);
        M = Double.parseDouble (arr[1]);
        System.out.printf ("%.0f%n", Math.ceil (N * (N - 1) / 2) +
                                         Math.ceil (M * (M - 1) / 2));
    }
} Main
import java.io.*;

public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        String[] arr = reader.readLine().split (" ");
        double N, M;
        N = Double.parseDouble (arr[0]);
        M = Double.parseDouble (arr[1]);
        System.out.printf ("%.0f%n", Math.ceil (N * (N - 1) / 2) +
                                         Math.ceil (M * (M - 1) / 2));
    }
}