import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner scan = new Scanner(System.in);
		int evens = scan.nextInt();
		int odds = scan.nextInt();
		int sum = 0;
		sum += (evens * (evens - 1)) / 2;
		sum += (odds * (odds - 1)) / 2;
		System.out.println(sum);
	}

} import java.io.*; io.* java import java.util.*; util.* java public class Main {
	public static void main(String[] args) throws Exception {
		Scanner scan = new Scanner(System.in);
		int evens = scan.nextInt();
		int odds = scan.nextInt();
		int sum = 0;
		sum += (evens * (evens - 1)) / 2;
		sum += (odds * (odds - 1)) / 2;
		System.out.println(sum);
	}

} Main public static void main(String[] args) throws Exception {
		Scanner scan = new Scanner(System.in);
		int evens = scan.nextInt();
		int odds = scan.nextInt();
		int sum = 0;
		sum += (evens * (evens - 1)) / 2;
		sum += (odds * (odds - 1)) / 2;
		System.out.println(sum);
	} main {
		Scanner scan = new Scanner(System.in);
		int evens = scan.nextInt();
		int odds = scan.nextInt();
		int sum = 0;
		sum += (evens * (evens - 1)) / 2;
		sum += (odds * (odds - 1)) / 2;
		System.out.println(sum);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int evens = scan.nextInt(); evens scan.nextInt() scan.nextInt scan int odds = scan.nextInt(); odds scan.nextInt() scan.nextInt scan int sum = 0; sum 0 sum += (evens * (evens - 1)) / 2 sum (evens * (evens - 1)) / 2 (evens * (evens - 1)) evens (evens - 1) evens 1 2 sum += (odds * (odds - 1)) / 2 sum (odds * (odds - 1)) / 2 (odds * (odds - 1)) odds (odds - 1) odds 1 2 System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		Scanner scan = new Scanner(System.in);
		int evens = scan.nextInt();
		int odds = scan.nextInt();
		int sum = 0;
		sum += (evens * (evens - 1)) / 2;
		sum += (odds * (odds - 1)) / 2;
		System.out.println(sum);
	}

} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner scan = new Scanner(System.in);
		int evens = scan.nextInt();
		int odds = scan.nextInt();
		int sum = 0;
		sum += (evens * (evens - 1)) / 2;
		sum += (odds * (odds - 1)) / 2;
		System.out.println(sum);
	}

} Main
import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner scan = new Scanner(System.in);
		int evens = scan.nextInt();
		int odds = scan.nextInt();
		int sum = 0;
		sum += (evens * (evens - 1)) / 2;
		sum += (odds * (odds - 1)) / 2;
		System.out.println(sum);
	}

}
