import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int m = in.nextInt();
		int r = solve(n, m);
		System.out.println(r);
		in.close();
	}

	private static int solve(int n, int m) {
		int r = 0;
		if (n > 1)
			r += (n * (n - 1) / 2);
		if (m > 1)
			r += (m * (m - 1) / 2);
		return r;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int m = in.nextInt();
		int r = solve(n, m);
		System.out.println(r);
		in.close();
	}

	private static int solve(int n, int m) {
		int r = 0;
		if (n > 1)
			r += (n * (n - 1) / 2);
		if (m > 1)
			r += (m * (m - 1) / 2);
		return r;
	}
} Main public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int m = in.nextInt();
		int r = solve(n, m);
		System.out.println(r);
		in.close();
	} main {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int m = in.nextInt();
		int r = solve(n, m);
		System.out.println(r);
		in.close();
	} Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); in new Scanner(new BufferedReader(new InputStreamReader(System.in))) int n = in.nextInt(); n in.nextInt() in.nextInt in int m = in.nextInt(); m in.nextInt() in.nextInt in int r = solve(n, m); r solve(n, m) solve n m System.out.println(r) System.out.println System.out System System.out r in.close() in.close in String[] args args private static int solve(int n, int m) {
		int r = 0;
		if (n > 1)
			r += (n * (n - 1) / 2);
		if (m > 1)
			r += (m * (m - 1) / 2);
		return r;
	} solve {
		int r = 0;
		if (n > 1)
			r += (n * (n - 1) / 2);
		if (m > 1)
			r += (m * (m - 1) / 2);
		return r;
	} int r = 0; r 0 if (n > 1)
			r += (n * (n - 1) / 2); n > 1 n 1 r += (n * (n - 1) / 2) r (n * (n - 1) / 2) n * (n - 1) n (n - 1) n 1 2 if (m > 1)
			r += (m * (m - 1) / 2); m > 1 m 1 r += (m * (m - 1) / 2) r (m * (m - 1) / 2) m * (m - 1) m (m - 1) m 1 2 return r; r int n n int m m public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int m = in.nextInt();
		int r = solve(n, m);
		System.out.println(r);
		in.close();
	}

	private static int solve(int n, int m) {
		int r = 0;
		if (n > 1)
			r += (n * (n - 1) / 2);
		if (m > 1)
			r += (m * (m - 1) / 2);
		return r;
	}
} public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int m = in.nextInt();
		int r = solve(n, m);
		System.out.println(r);
		in.close();
	}

	private static int solve(int n, int m) {
		int r = 0;
		if (n > 1)
			r += (n * (n - 1) / 2);
		if (m > 1)
			r += (m * (m - 1) / 2);
		return r;
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int m = in.nextInt();
		int r = solve(n, m);
		System.out.println(r);
		in.close();
	}

	private static int solve(int n, int m) {
		int r = 0;
		if (n > 1)
			r += (n * (n - 1) / 2);
		if (m > 1)
			r += (m * (m - 1) / 2);
		return r;
	}
}