import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int s = 0;
		for (int i = N - 1; i > 0; i--)
			s = s + i;
		for (int i = M - 1; i > 0; i--)
			s = s + i;
		System.out.println("" + s);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int s = 0;
		for (int i = N - 1; i > 0; i--)
			s = s + i;
		for (int i = M - 1; i > 0; i--)
			s = s + i;
		System.out.println("" + s);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int s = 0;
		for (int i = N - 1; i > 0; i--)
			s = s + i;
		for (int i = M - 1; i > 0; i--)
			s = s + i;
		System.out.println("" + s);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int s = 0;
		for (int i = N - 1; i > 0; i--)
			s = s + i;
		for (int i = M - 1; i > 0; i--)
			s = s + i;
		System.out.println("" + s);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int M = sc.nextInt(); M sc.nextInt() sc.nextInt sc int s = 0; s 0 for (int i = N - 1; i > 0; i--)
			s = s + i; int i = N - 1; int i = N - 1; i N - 1 N 1 i > 0 i 0 i-- i-- i s = s + i; s = s + i s s + i s i for (int i = M - 1; i > 0; i--)
			s = s + i; int i = M - 1; int i = M - 1; i M - 1 M 1 i > 0 i 0 i-- i-- i s = s + i; s = s + i s s + i s i System.out.println("" + s) System.out.println System.out System System.out "" + s "" s String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int s = 0;
		for (int i = N - 1; i > 0; i--)
			s = s + i;
		for (int i = M - 1; i > 0; i--)
			s = s + i;
		System.out.println("" + s);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int s = 0;
		for (int i = N - 1; i > 0; i--)
			s = s + i;
		for (int i = M - 1; i > 0; i--)
			s = s + i;
		System.out.println("" + s);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int s = 0;
		for (int i = N - 1; i > 0; i--)
			s = s + i;
		for (int i = M - 1; i > 0; i--)
			s = s + i;
		System.out.println("" + s);
	}
}