import java.util.ArrayList;
import java.util.List;
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();
		//奇数+奇数か偶数+偶数しかありえない
		if(even == 0) {
			System.out.println(odd*(odd-1)/2);
			return;
		}
		if(odd == 0) {
			System.out.println(even*(even-1)/2);
			return;
		}
		
		System.out.println( odd*(odd-1)/2 + even*(even-1)/2);
		
	}
		
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util 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();
		//奇数+奇数か偶数+偶数しかありえない
		if(even == 0) {
			System.out.println(odd*(odd-1)/2);
			return;
		}
		if(odd == 0) {
			System.out.println(even*(even-1)/2);
			return;
		}
		
		System.out.println( odd*(odd-1)/2 + even*(even-1)/2);
		
	}
		
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int even = sc.nextInt();
		int odd = sc.nextInt();
		//奇数+奇数か偶数+偶数しかありえない
		if(even == 0) {
			System.out.println(odd*(odd-1)/2);
			return;
		}
		if(odd == 0) {
			System.out.println(even*(even-1)/2);
			return;
		}
		
		System.out.println( odd*(odd-1)/2 + even*(even-1)/2);
		
	} main {

		Scanner sc = new Scanner(System.in);
		int even = sc.nextInt();
		int odd = sc.nextInt();
		//奇数+奇数か偶数+偶数しかありえない
		if(even == 0) {
			System.out.println(odd*(odd-1)/2);
			return;
		}
		if(odd == 0) {
			System.out.println(even*(even-1)/2);
			return;
		}
		
		System.out.println( odd*(odd-1)/2 + even*(even-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 if(even == 0) {
			System.out.println(odd*(odd-1)/2);
			return;
		} even == 0 even 0 {
			System.out.println(odd*(odd-1)/2);
			return;
		} System.out.println(odd*(odd-1)/2) System.out.println System.out System System.out odd*(odd-1)/2 odd*(odd-1) odd (odd-1) odd 1 2 return; if(odd == 0) {
			System.out.println(even*(even-1)/2);
			return;
		} odd == 0 odd 0 {
			System.out.println(even*(even-1)/2);
			return;
		} System.out.println(even*(even-1)/2) System.out.println System.out System System.out even*(even-1)/2 even*(even-1) even (even-1) even 1 2 return; System.out.println( odd*(odd-1)/2 + even*(even-1)/2) System.out.println System.out System System.out odd*(odd-1)/2 + even*(even-1)/2 odd*(odd-1)/2 odd*(odd-1) odd (odd-1) odd 1 2 even*(even-1)/2 even*(even-1) even (even-1) even 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();
		//奇数+奇数か偶数+偶数しかありえない
		if(even == 0) {
			System.out.println(odd*(odd-1)/2);
			return;
		}
		if(odd == 0) {
			System.out.println(even*(even-1)/2);
			return;
		}
		
		System.out.println( odd*(odd-1)/2 + even*(even-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();
		//奇数+奇数か偶数+偶数しかありえない
		if(even == 0) {
			System.out.println(odd*(odd-1)/2);
			return;
		}
		if(odd == 0) {
			System.out.println(even*(even-1)/2);
			return;
		}
		
		System.out.println( odd*(odd-1)/2 + even*(even-1)/2);
		
	}
		
} Main
import java.util.ArrayList;
import java.util.List;
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();
		//奇数+奇数か偶数+偶数しかありえない
		if(even == 0) {
			System.out.println(odd*(odd-1)/2);
			return;
		}
		if(odd == 0) {
			System.out.println(even*(even-1)/2);
			return;
		}
		
		System.out.println( odd*(odd-1)/2 + even*(even-1)/2);
		
	}
		
}