import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int nSum = (N * (N-1)) / 2;
        int mSum = (M * (M-1)) / 2;
        System.out.println(nSum + mSum);

    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int nSum = (N * (N-1)) / 2;
        int mSum = (M * (M-1)) / 2;
        System.out.println(nSum + mSum);

    }
} Main public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int nSum = (N * (N-1)) / 2;
        int mSum = (M * (M-1)) / 2;
        System.out.println(nSum + mSum);

    } main {

        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int nSum = (N * (N-1)) / 2;
        int mSum = (M * (M-1)) / 2;
        System.out.println(nSum + mSum);

    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int M = scanner.nextInt(); M scanner.nextInt() scanner.nextInt scanner int nSum = (N * (N-1)) / 2; nSum (N * (N-1)) / 2 (N * (N-1)) N (N-1) N 1 2 int mSum = (M * (M-1)) / 2; mSum (M * (M-1)) / 2 (M * (M-1)) M (M-1) M 1 2 System.out.println(nSum + mSum) System.out.println System.out System System.out nSum + mSum nSum mSum String[] args args public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int nSum = (N * (N-1)) / 2;
        int mSum = (M * (M-1)) / 2;
        System.out.println(nSum + mSum);

    }
} public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int nSum = (N * (N-1)) / 2;
        int mSum = (M * (M-1)) / 2;
        System.out.println(nSum + mSum);

    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int nSum = (N * (N-1)) / 2;
        int mSum = (M * (M-1)) / 2;
        System.out.println(nSum + mSum);

    }
}