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 numberOfCombinationsForN = 0;
        for (int i = N - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        }

        int numberOfCombinationsForM = 0;
        for (int i = M - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        }
        System.out.println(numberOfCombinationsForN + numberOfCombinationsForM);
    }
} 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 numberOfCombinationsForN = 0;
        for (int i = N - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        }

        int numberOfCombinationsForM = 0;
        for (int i = M - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        }
        System.out.println(numberOfCombinationsForN + numberOfCombinationsForM);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();

        int numberOfCombinationsForN = 0;
        for (int i = N - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        }

        int numberOfCombinationsForM = 0;
        for (int i = M - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        }
        System.out.println(numberOfCombinationsForN + numberOfCombinationsForM);
    } main {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();

        int numberOfCombinationsForN = 0;
        for (int i = N - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        }

        int numberOfCombinationsForM = 0;
        for (int i = M - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        }
        System.out.println(numberOfCombinationsForN + numberOfCombinationsForM);
    } 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 numberOfCombinationsForN = 0; numberOfCombinationsForN 0 for (int i = N - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        } int i = N - 1; int i = N - 1; i N - 1 N 1 i > 0 i 0 i-- i-- i {
            numberOfCombinationsForN += i;
        } {
            numberOfCombinationsForN += i;
        } numberOfCombinationsForN += i numberOfCombinationsForN i int numberOfCombinationsForM = 0; numberOfCombinationsForM 0 for (int i = M - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        } int i = M - 1; int i = M - 1; i M - 1 M 1 i > 0 i 0 i-- i-- i {
            numberOfCombinationsForN += i;
        } {
            numberOfCombinationsForN += i;
        } numberOfCombinationsForN += i numberOfCombinationsForN i System.out.println(numberOfCombinationsForN + numberOfCombinationsForM) System.out.println System.out System System.out numberOfCombinationsForN + numberOfCombinationsForM numberOfCombinationsForN numberOfCombinationsForM 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 numberOfCombinationsForN = 0;
        for (int i = N - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        }

        int numberOfCombinationsForM = 0;
        for (int i = M - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        }
        System.out.println(numberOfCombinationsForN + numberOfCombinationsForM);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();

        int numberOfCombinationsForN = 0;
        for (int i = N - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        }

        int numberOfCombinationsForM = 0;
        for (int i = M - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        }
        System.out.println(numberOfCombinationsForN + numberOfCombinationsForM);
    }
} 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 numberOfCombinationsForN = 0;
        for (int i = N - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        }

        int numberOfCombinationsForM = 0;
        for (int i = M - 1; i > 0; i--) {
            numberOfCombinationsForN += i;
        }
        System.out.println(numberOfCombinationsForN + numberOfCombinationsForM);
    }
}