import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int M = scanner.nextInt();
		int N = scanner.nextInt();
		System.out.print((M*(M-1) + N*(N-1))/2);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int M = scanner.nextInt();
		int N = scanner.nextInt();
		System.out.print((M*(M-1) + N*(N-1))/2);
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int M = scanner.nextInt();
		int N = scanner.nextInt();
		System.out.print((M*(M-1) + N*(N-1))/2);
	} main {
		Scanner scanner = new Scanner(System.in);
		int M = scanner.nextInt();
		int N = scanner.nextInt();
		System.out.print((M*(M-1) + N*(N-1))/2);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int M = scanner.nextInt(); M scanner.nextInt() scanner.nextInt scanner int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner System.out.print((M*(M-1) + N*(N-1))/2) System.out.print System.out System System.out (M*(M-1) + N*(N-1))/2 (M*(M-1) + N*(N-1)) M*(M-1) M (M-1) M 1 N*(N-1) N (N-1) N 1 2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int M = scanner.nextInt();
		int N = scanner.nextInt();
		System.out.print((M*(M-1) + N*(N-1))/2);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int M = scanner.nextInt();
		int N = scanner.nextInt();
		System.out.print((M*(M-1) + N*(N-1))/2);
	}
} Main
import java.util.Scanner;

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