import java.io.IOException;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int ans = (n * (n - 1) / 2) + (m * (m - 1)/ 2);
        System.out.println(ans);
    }
} import java.io.IOException; IOException java.io import java.util.*; util.* java public class Main {

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int ans = (n * (n - 1) / 2) + (m * (m - 1)/ 2);
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int ans = (n * (n - 1) / 2) + (m * (m - 1)/ 2);
        System.out.println(ans);
    } main {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int ans = (n * (n - 1) / 2) + (m * (m - 1)/ 2);
        System.out.println(ans);
    } 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 ans = (n * (n - 1) / 2) + (m * (m - 1)/ 2); ans (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.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int ans = (n * (n - 1) / 2) + (m * (m - 1)/ 2);
        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int ans = (n * (n - 1) / 2) + (m * (m - 1)/ 2);
        System.out.println(ans);
    }
} Main
import java.io.IOException;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int ans = (n * (n - 1) / 2) + (m * (m - 1)/ 2);
        System.out.println(ans);
    }
}