import java.util.Scanner;

public class Main {
	static Scanner scn = new Scanner(System.in);

	public static void main(String[] args) {
		int n = scn.nextInt();
		int m = scn.nextInt();
		int ans1 = 0;
		if (n > 1) {
			ans1 = n * (n - 1) / 2;
		}
		int ans2 = 0;
		if (m > 1) {
			ans2 = m * (m - 1) / 2;
		}
		System.out.println(ans1 + ans2);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	static Scanner scn = new Scanner(System.in);

	public static void main(String[] args) {
		int n = scn.nextInt();
		int m = scn.nextInt();
		int ans1 = 0;
		if (n > 1) {
			ans1 = n * (n - 1) / 2;
		}
		int ans2 = 0;
		if (m > 1) {
			ans2 = m * (m - 1) / 2;
		}
		System.out.println(ans1 + ans2);
	}
} Main static Scanner scn = new Scanner(System.in); scn new Scanner(System.in) public static void main(String[] args) {
		int n = scn.nextInt();
		int m = scn.nextInt();
		int ans1 = 0;
		if (n > 1) {
			ans1 = n * (n - 1) / 2;
		}
		int ans2 = 0;
		if (m > 1) {
			ans2 = m * (m - 1) / 2;
		}
		System.out.println(ans1 + ans2);
	} main {
		int n = scn.nextInt();
		int m = scn.nextInt();
		int ans1 = 0;
		if (n > 1) {
			ans1 = n * (n - 1) / 2;
		}
		int ans2 = 0;
		if (m > 1) {
			ans2 = m * (m - 1) / 2;
		}
		System.out.println(ans1 + ans2);
	} int n = scn.nextInt(); n scn.nextInt() scn.nextInt scn int m = scn.nextInt(); m scn.nextInt() scn.nextInt scn int ans1 = 0; ans1 0 if (n > 1) {
			ans1 = n * (n - 1) / 2;
		} n > 1 n 1 {
			ans1 = n * (n - 1) / 2;
		} ans1 = n * (n - 1) / 2 ans1 n * (n - 1) / 2 n * (n - 1) n (n - 1) n 1 2 int ans2 = 0; ans2 0 if (m > 1) {
			ans2 = m * (m - 1) / 2;
		} m > 1 m 1 {
			ans2 = m * (m - 1) / 2;
		} ans2 = m * (m - 1) / 2 ans2 m * (m - 1) / 2 m * (m - 1) m (m - 1) m 1 2 System.out.println(ans1 + ans2) System.out.println System.out System System.out ans1 + ans2 ans1 ans2 String[] args args public class Main {
	static Scanner scn = new Scanner(System.in);

	public static void main(String[] args) {
		int n = scn.nextInt();
		int m = scn.nextInt();
		int ans1 = 0;
		if (n > 1) {
			ans1 = n * (n - 1) / 2;
		}
		int ans2 = 0;
		if (m > 1) {
			ans2 = m * (m - 1) / 2;
		}
		System.out.println(ans1 + ans2);
	}
} public class Main {
	static Scanner scn = new Scanner(System.in);

	public static void main(String[] args) {
		int n = scn.nextInt();
		int m = scn.nextInt();
		int ans1 = 0;
		if (n > 1) {
			ans1 = n * (n - 1) / 2;
		}
		int ans2 = 0;
		if (m > 1) {
			ans2 = m * (m - 1) / 2;
		}
		System.out.println(ans1 + ans2);
	}
} Main
import java.util.Scanner;

public class Main {
	static Scanner scn = new Scanner(System.in);

	public static void main(String[] args) {
		int n = scn.nextInt();
		int m = scn.nextInt();
		int ans1 = 0;
		if (n > 1) {
			ans1 = n * (n - 1) / 2;
		}
		int ans2 = 0;
		if (m > 1) {
			ans2 = m * (m - 1) / 2;
		}
		System.out.println(ans1 + ans2);
	}
}
