import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int n = Integer.parseInt(chr[0]);
			int m = Integer.parseInt(chr[1]);
			 System.out.println((n+m)*(n+m-1) / 2 - n * m);
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main{
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int n = Integer.parseInt(chr[0]);
			int m = Integer.parseInt(chr[1]);
			 System.out.println((n+m)*(n+m-1) / 2 - n * m);
		}
	}
} Main public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int n = Integer.parseInt(chr[0]);
			int m = Integer.parseInt(chr[1]);
			 System.out.println((n+m)*(n+m-1) / 2 - n * m);
		}
	} main {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int n = Integer.parseInt(chr[0]);
			int m = Integer.parseInt(chr[1]);
			 System.out.println((n+m)*(n+m-1) / 2 - n * m);
		}
	} try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int n = Integer.parseInt(chr[0]);
			int m = Integer.parseInt(chr[1]);
			 System.out.println((n+m)*(n+m-1) / 2 - n * m);
		} {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int n = Integer.parseInt(chr[0]);
			int m = Integer.parseInt(chr[1]);
			 System.out.println((n+m)*(n+m-1) / 2 - n * m);
		} BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in)) new BufferedReader(
				new InputStreamReader(System.in)) String in = br.readLine(); in br.readLine() br.readLine br String chr[] = in.split(" "); chr in.split(" ") in.split in " " int n = Integer.parseInt(chr[0]); n Integer.parseInt(chr[0]) Integer.parseInt Integer chr[0] chr 0 int m = Integer.parseInt(chr[1]); m Integer.parseInt(chr[1]) Integer.parseInt Integer chr[1] chr 1 System.out.println((n+m)*(n+m-1) / 2 - n * m) System.out.println System.out System System.out (n+m)*(n+m-1) / 2 - n * m (n+m)*(n+m-1) / 2 (n+m)*(n+m-1) (n+m) n m (n+m-1) n+m n m 1 2 n * m n m String[] args args public class Main{
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int n = Integer.parseInt(chr[0]);
			int m = Integer.parseInt(chr[1]);
			 System.out.println((n+m)*(n+m-1) / 2 - n * m);
		}
	}
} public class Main{
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int n = Integer.parseInt(chr[0]);
			int m = Integer.parseInt(chr[1]);
			 System.out.println((n+m)*(n+m-1) / 2 - n * m);
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int n = Integer.parseInt(chr[0]);
			int m = Integer.parseInt(chr[1]);
			 System.out.println((n+m)*(n+m-1) / 2 - n * m);
		}
	}
}