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();  //奇数の個数
		int total = 0;

		if(even>=2 && odd >=2) {
			total = even*(even-1)/2 + odd*(odd-1)/2;
		}
		else if(even>=2 && odd <2) {
			total = even*(even-1)/2;
		}
		else if(even<2 && odd>=2) {
			total = odd*(odd-1)/2;
		}
		System.out.print(total);
	}
} 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();  //奇数の個数
		int total = 0;

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

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

		if(even>=2 && odd >=2) {
			total = even*(even-1)/2 + odd*(odd-1)/2;
		}
		else if(even>=2 && odd <2) {
			total = even*(even-1)/2;
		}
		else if(even<2 && odd>=2) {
			total = odd*(odd-1)/2;
		}
		System.out.print(total);
	} 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 int total = 0; total 0 if(even>=2 && odd >=2) {
			total = even*(even-1)/2 + odd*(odd-1)/2;
		}
		else if(even>=2 && odd <2) {
			total = even*(even-1)/2;
		}
		else if(even<2 && odd>=2) {
			total = odd*(odd-1)/2;
		} even>=2 && odd >=2 even>=2 even 2 odd >=2 odd 2 {
			total = even*(even-1)/2 + odd*(odd-1)/2;
		} total = even*(even-1)/2 + odd*(odd-1)/2 total 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 if(even>=2 && odd <2) {
			total = even*(even-1)/2;
		}
		else if(even<2 && odd>=2) {
			total = odd*(odd-1)/2;
		} even>=2 && odd <2 even>=2 even 2 odd <2 odd 2 {
			total = even*(even-1)/2;
		} total = even*(even-1)/2 total even*(even-1)/2 even*(even-1) even (even-1) even 1 2 if(even<2 && odd>=2) {
			total = odd*(odd-1)/2;
		} even<2 && odd>=2 even<2 even 2 odd>=2 odd 2 {
			total = odd*(odd-1)/2;
		} total = odd*(odd-1)/2 total odd*(odd-1)/2 odd*(odd-1) odd (odd-1) odd 1 2 System.out.print(total) System.out.print System.out System System.out total 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();  //奇数の個数
		int total = 0;

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

		if(even>=2 && odd >=2) {
			total = even*(even-1)/2 + odd*(odd-1)/2;
		}
		else if(even>=2 && odd <2) {
			total = even*(even-1)/2;
		}
		else if(even<2 && odd>=2) {
			total = odd*(odd-1)/2;
		}
		System.out.print(total);
	}
} 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();  //奇数の個数
		int total = 0;

		if(even>=2 && odd >=2) {
			total = even*(even-1)/2 + odd*(odd-1)/2;
		}
		else if(even>=2 && odd <2) {
			total = even*(even-1)/2;
		}
		else if(even<2 && odd>=2) {
			total = odd*(odd-1)/2;
		}
		System.out.print(total);
	}
}
