import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int even = sc.nextInt();  //偶数の個数
		int odd = sc.nextInt();  //奇数の個数

		System.out.print(even*(even-1)/2+odd*(odd-1)/2);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int even = sc.nextInt();  //偶数の個数
		int odd = sc.nextInt();  //奇数の個数

		System.out.print(even*(even-1)/2+odd*(odd-1)/2);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int even = sc.nextInt();  //偶数の個数
		int odd = sc.nextInt();  //奇数の個数

		System.out.print(even*(even-1)/2+odd*(odd-1)/2);
	} main {
		Scanner sc = new Scanner(System.in);
		int even = sc.nextInt();  //偶数の個数
		int odd = sc.nextInt();  //奇数の個数

		System.out.print(even*(even-1)/2+odd*(odd-1)/2);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int even = sc.nextInt(); even sc.nextInt() sc.nextInt sc int odd = sc.nextInt(); odd sc.nextInt() sc.nextInt sc System.out.print(even*(even-1)/2+odd*(odd-1)/2) System.out.print System.out System System.out even*(even-1)/2+odd*(odd-1)/2 even*(even-1)/2 even*(even-1) even (even-1) even 1 2 odd*(odd-1)/2 odd*(odd-1) odd (odd-1) odd 1 2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int even = sc.nextInt();  //偶数の個数
		int odd = sc.nextInt();  //奇数の個数

		System.out.print(even*(even-1)/2+odd*(odd-1)/2);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int even = sc.nextInt();  //偶数の個数
		int odd = sc.nextInt();  //奇数の個数

		System.out.print(even*(even-1)/2+odd*(odd-1)/2);
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int even = sc.nextInt();  //偶数の個数
		int odd = sc.nextInt();  //奇数の個数

		System.out.print(even*(even-1)/2+odd*(odd-1)/2);
	}
}
