

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int anser;

		if (n == 0) {
			anser = m * (m - 1) / 2;
		} else if (m == 0) {
			anser = n * (n - 1) / 2;
		} else {
			anser = (n * (n - 1) + m * (m - 1)) / 2;
		}

		System.out.println(anser);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int anser;

		if (n == 0) {
			anser = m * (m - 1) / 2;
		} else if (m == 0) {
			anser = n * (n - 1) / 2;
		} else {
			anser = (n * (n - 1) + m * (m - 1)) / 2;
		}

		System.out.println(anser);
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int anser;

		if (n == 0) {
			anser = m * (m - 1) / 2;
		} else if (m == 0) {
			anser = n * (n - 1) / 2;
		} else {
			anser = (n * (n - 1) + m * (m - 1)) / 2;
		}

		System.out.println(anser);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int anser;

		if (n == 0) {
			anser = m * (m - 1) / 2;
		} else if (m == 0) {
			anser = n * (n - 1) / 2;
		} else {
			anser = (n * (n - 1) + m * (m - 1)) / 2;
		}

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

		int anser;

		if (n == 0) {
			anser = m * (m - 1) / 2;
		} else if (m == 0) {
			anser = n * (n - 1) / 2;
		} else {
			anser = (n * (n - 1) + m * (m - 1)) / 2;
		}

		System.out.println(anser);
	}

} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int anser;

		if (n == 0) {
			anser = m * (m - 1) / 2;
		} else if (m == 0) {
			anser = n * (n - 1) / 2;
		} else {
			anser = (n * (n - 1) + m * (m - 1)) / 2;
		}

		System.out.println(anser);
	}

} Main


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int anser;

		if (n == 0) {
			anser = m * (m - 1) / 2;
		} else if (m == 0) {
			anser = n * (n - 1) / 2;
		} else {
			anser = (n * (n - 1) + m * (m - 1)) / 2;
		}

		System.out.println(anser);
	}

}
