import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;

class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 32768);
		PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

		solve(reader, writer);
		reader.close();
		writer.close();
	}

	private static void solve(BufferedReader reader, PrintWriter writer) throws IOException {
		String[] temp = (reader.readLine()).split(" ");
		int n = Integer.parseInt(temp[0]);
		int m = Integer.parseInt(temp[1]);
		int result = 0;
		if (n >= 2) {
			result += (n * (n - 1)) / 2;
		}
		if (m >= 2) {
			result += (m * (m - 1)) / 2;
		}
		writer.println(result);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.BufferedWriter; BufferedWriter java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.OutputStreamWriter; OutputStreamWriter java.io import java.io.PrintWriter; PrintWriter java.io class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 32768);
		PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

		solve(reader, writer);
		reader.close();
		writer.close();
	}

	private static void solve(BufferedReader reader, PrintWriter writer) throws IOException {
		String[] temp = (reader.readLine()).split(" ");
		int n = Integer.parseInt(temp[0]);
		int m = Integer.parseInt(temp[1]);
		int result = 0;
		if (n >= 2) {
			result += (n * (n - 1)) / 2;
		}
		if (m >= 2) {
			result += (m * (m - 1)) / 2;
		}
		writer.println(result);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 32768);
		PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

		solve(reader, writer);
		reader.close();
		writer.close();
	} main {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 32768);
		PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

		solve(reader, writer);
		reader.close();
		writer.close();
	} BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 32768); reader new BufferedReader(new InputStreamReader(System.in), 32768) PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); writer new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))) solve(reader, writer) solve reader writer reader.close() reader.close reader writer.close() writer.close writer String[] args args private static void solve(BufferedReader reader, PrintWriter writer) throws IOException {
		String[] temp = (reader.readLine()).split(" ");
		int n = Integer.parseInt(temp[0]);
		int m = Integer.parseInt(temp[1]);
		int result = 0;
		if (n >= 2) {
			result += (n * (n - 1)) / 2;
		}
		if (m >= 2) {
			result += (m * (m - 1)) / 2;
		}
		writer.println(result);
	} solve {
		String[] temp = (reader.readLine()).split(" ");
		int n = Integer.parseInt(temp[0]);
		int m = Integer.parseInt(temp[1]);
		int result = 0;
		if (n >= 2) {
			result += (n * (n - 1)) / 2;
		}
		if (m >= 2) {
			result += (m * (m - 1)) / 2;
		}
		writer.println(result);
	} String[] temp = (reader.readLine()).split(" "); temp (reader.readLine()).split(" ") (reader.readLine()).split (reader.readLine()) reader.readLine reader " " int n = Integer.parseInt(temp[0]); n Integer.parseInt(temp[0]) Integer.parseInt Integer temp[0] temp 0 int m = Integer.parseInt(temp[1]); m Integer.parseInt(temp[1]) Integer.parseInt Integer temp[1] temp 1 int result = 0; result 0 if (n >= 2) {
			result += (n * (n - 1)) / 2;
		} n >= 2 n 2 {
			result += (n * (n - 1)) / 2;
		} result += (n * (n - 1)) / 2 result (n * (n - 1)) / 2 (n * (n - 1)) n (n - 1) n 1 2 if (m >= 2) {
			result += (m * (m - 1)) / 2;
		} m >= 2 m 2 {
			result += (m * (m - 1)) / 2;
		} result += (m * (m - 1)) / 2 result (m * (m - 1)) / 2 (m * (m - 1)) m (m - 1) m 1 2 writer.println(result) writer.println writer result BufferedReader reader reader PrintWriter writer writer
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;

class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 32768);
		PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

		solve(reader, writer);
		reader.close();
		writer.close();
	}

	private static void solve(BufferedReader reader, PrintWriter writer) throws IOException {
		String[] temp = (reader.readLine()).split(" ");
		int n = Integer.parseInt(temp[0]);
		int m = Integer.parseInt(temp[1]);
		int result = 0;
		if (n >= 2) {
			result += (n * (n - 1)) / 2;
		}
		if (m >= 2) {
			result += (m * (m - 1)) / 2;
		}
		writer.println(result);
	}
}
