//--- pA ---//
import java.util.*;
import java.lang.*;
import java.io.*;
public class Main {
	public static void main (String[] args) throws java.lang.Exception {
		new Solution();
	}
}
class Solution {
	Reader reader;
	public Solution () {
		reader = new Reader();
		while (reader.hasNext()) {
			run_case();
		}
	}
	int[] fact;
	private void run_case() {
		int N = reader.ni(), M = reader.ni();

		fact = new int[101];
		fact[0] = 1;
		for (int i=1; i<101; i++) {
			fact[i] = fact[i-1] * i;
		}

		long res = nCr(N, 2) + nCr(M, 2);
		System.out.println(res);

		return;
	}

	private long nCr(int n, int r) {
		if (n < r) return 0;
	    // return fact[n] / fact[n - r] / fact[r];
		long res = 1;
		for (long i=n-r+1; i<=n; i++) {
			res *= i;
		}
		res /= 2;
		return res;
	}
	//
	// // Returns factorial of n
	// private int fact(int n) {
	//     int res = 1;
	//     for (int i = 2; i <= n; i++)
	//         res = res * i;
	//     return res;
	// }
}


class Reader {
	BufferedReader br;
	StringTokenizer st;
	public Reader(){
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	public String next() {
		if (st.hasMoreTokens()) return st.nextToken();
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return st.nextToken();
	}
	public boolean hasNext() {
		try {
			if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}
	public int ni() {return Integer.parseInt(this.next());}
	public String ns() {return this.next();}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main {
	public static void main (String[] args) throws java.lang.Exception {
		new Solution();
	}
} Main public static void main (String[] args) throws java.lang.Exception {
		new Solution();
	} main {
		new Solution();
	} new Solution() String[] args args class Solution {
	Reader reader;
	public Solution () {
		reader = new Reader();
		while (reader.hasNext()) {
			run_case();
		}
	}
	int[] fact;
	private void run_case() {
		int N = reader.ni(), M = reader.ni();

		fact = new int[101];
		fact[0] = 1;
		for (int i=1; i<101; i++) {
			fact[i] = fact[i-1] * i;
		}

		long res = nCr(N, 2) + nCr(M, 2);
		System.out.println(res);

		return;
	}

	private long nCr(int n, int r) {
		if (n < r) return 0;
	    // return fact[n] / fact[n - r] / fact[r];
		long res = 1;
		for (long i=n-r+1; i<=n; i++) {
			res *= i;
		}
		res /= 2;
		return res;
	}
	//
	// // Returns factorial of n
	// private int fact(int n) {
	//     int res = 1;
	//     for (int i = 2; i <= n; i++)
	//         res = res * i;
	//     return res;
	// }
} Solution Reader reader; reader int[] fact; fact public Solution () {
		reader = new Reader();
		while (reader.hasNext()) {
			run_case();
		}
	} Solution {
		reader = new Reader();
		while (reader.hasNext()) {
			run_case();
		}
	} reader = new Reader() reader new Reader() while (reader.hasNext()) {
			run_case();
		} reader.hasNext() reader.hasNext reader {
			run_case();
		} run_case() run_case private void run_case() {
		int N = reader.ni(), M = reader.ni();

		fact = new int[101];
		fact[0] = 1;
		for (int i=1; i<101; i++) {
			fact[i] = fact[i-1] * i;
		}

		long res = nCr(N, 2) + nCr(M, 2);
		System.out.println(res);

		return;
	} run_case {
		int N = reader.ni(), M = reader.ni();

		fact = new int[101];
		fact[0] = 1;
		for (int i=1; i<101; i++) {
			fact[i] = fact[i-1] * i;
		}

		long res = nCr(N, 2) + nCr(M, 2);
		System.out.println(res);

		return;
	} int N = reader.ni() N reader.ni() reader.ni reader M = reader.ni(); M reader.ni() reader.ni reader fact = new int[101] fact new int[101] 101 fact[0] = 1 fact[0] fact 0 1 for (int i=1; i<101; i++) {
			fact[i] = fact[i-1] * i;
		} int i=1; int i=1; i 1 i<101 i 101 i++ i++ i {
			fact[i] = fact[i-1] * i;
		} {
			fact[i] = fact[i-1] * i;
		} fact[i] = fact[i-1] * i fact[i] fact i fact[i-1] * i fact[i-1] fact i-1 i 1 i long res = nCr(N, 2) + nCr(M, 2); res nCr(N, 2) + nCr(M, 2) nCr(N, 2) nCr N 2 nCr(M, 2) nCr M 2 System.out.println(res) System.out.println System.out System System.out res return; private long nCr(int n, int r) {
		if (n < r) return 0;
	    // return fact[n] / fact[n - r] / fact[r];
		long res = 1;
		for (long i=n-r+1; i<=n; i++) {
			res *= i;
		}
		res /= 2;
		return res;
	} nCr {
		if (n < r) return 0;
	    // return fact[n] / fact[n - r] / fact[r];
		long res = 1;
		for (long i=n-r+1; i<=n; i++) {
			res *= i;
		}
		res /= 2;
		return res;
	} if (n < r) return 0; n < r n r return 0; 0 long res = 1; res 1 for (long i=n-r+1; i<=n; i++) {
			res *= i;
		} long i=n-r+1; long i=n-r+1; i n-r+1 n-r n r 1 i<=n i n i++ i++ i {
			res *= i;
		} {
			res *= i;
		} res *= i res i res /= 2 res 2 return res; res int n n int r r class Reader {
	BufferedReader br;
	StringTokenizer st;
	public Reader(){
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	public String next() {
		if (st.hasMoreTokens()) return st.nextToken();
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return st.nextToken();
	}
	public boolean hasNext() {
		try {
			if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}
	public int ni() {return Integer.parseInt(this.next());}
	public String ns() {return this.next();}
} Reader BufferedReader br; br StringTokenizer st; st public Reader(){
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
	} Reader {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
	} try {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer(br.readLine());
		} br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) public String next() {
		if (st.hasMoreTokens()) return st.nextToken();
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return st.nextToken();
	} next {
		if (st.hasMoreTokens()) return st.nextToken();
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return st.nextToken();
	} if (st.hasMoreTokens()) return st.nextToken(); st.hasMoreTokens() st.hasMoreTokens st return st.nextToken(); st.nextToken() st.nextToken st try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			st = new StringTokenizer(br.readLine());
		} st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st public boolean hasNext() {
		try {
			if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	} hasNext {
		try {
			if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	} try {
			if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true;
		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true;
		} if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true; !st.hasMoreTokens() && !br.ready() !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st !br.ready() br.ready() br.ready br return false; false return true; true return false; false public int ni() {return Integer.parseInt(this.next());} ni {return Integer.parseInt(this.next());} return Integer.parseInt(this.next()); Integer.parseInt(this.next()) Integer.parseInt Integer this.next() this.next this public String ns() {return this.next();} ns {return this.next();} return this.next(); this.next() this.next this public class Main {
	public static void main (String[] args) throws java.lang.Exception {
		new Solution();
	}
} public class Main {
	public static void main (String[] args) throws java.lang.Exception {
		new Solution();
	}
} Main
//--- pA ---//
import java.util.*;
import java.lang.*;
import java.io.*;
public class Main {
	public static void main (String[] args) throws java.lang.Exception {
		new Solution();
	}
}
class Solution {
	Reader reader;
	public Solution () {
		reader = new Reader();
		while (reader.hasNext()) {
			run_case();
		}
	}
	int[] fact;
	private void run_case() {
		int N = reader.ni(), M = reader.ni();

		fact = new int[101];
		fact[0] = 1;
		for (int i=1; i<101; i++) {
			fact[i] = fact[i-1] * i;
		}

		long res = nCr(N, 2) + nCr(M, 2);
		System.out.println(res);

		return;
	}

	private long nCr(int n, int r) {
		if (n < r) return 0;
	    // return fact[n] / fact[n - r] / fact[r];
		long res = 1;
		for (long i=n-r+1; i<=n; i++) {
			res *= i;
		}
		res /= 2;
		return res;
	}
	//
	// // Returns factorial of n
	// private int fact(int n) {
	//     int res = 1;
	//     for (int i = 2; i <= n; i++)
	//         res = res * i;
	//     return res;
	// }
}


class Reader {
	BufferedReader br;
	StringTokenizer st;
	public Reader(){
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	public String next() {
		if (st.hasMoreTokens()) return st.nextToken();
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return st.nextToken();
	}
	public boolean hasNext() {
		try {
			if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}
	public int ni() {return Integer.parseInt(this.next());}
	public String ns() {return this.next();}
}
