import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int N,M;
		int sum=0;
		N=cin.nextInt();
		M=cin.nextInt();
		sum=N*(N-1)/2+M*(M-1)/2;
		System.out.println(sum);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int N,M;
		int sum=0;
		N=cin.nextInt();
		M=cin.nextInt();
		sum=N*(N-1)/2+M*(M-1)/2;
		System.out.println(sum);
	}

} Main public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int N,M;
		int sum=0;
		N=cin.nextInt();
		M=cin.nextInt();
		sum=N*(N-1)/2+M*(M-1)/2;
		System.out.println(sum);
	} main {
		Scanner cin = new Scanner(System.in);
		int N,M;
		int sum=0;
		N=cin.nextInt();
		M=cin.nextInt();
		sum=N*(N-1)/2+M*(M-1)/2;
		System.out.println(sum);
	} Scanner cin = new Scanner(System.in); cin new Scanner(System.in) int N N M; M int sum=0; sum 0 N=cin.nextInt() N cin.nextInt() cin.nextInt cin M=cin.nextInt() M cin.nextInt() cin.nextInt cin sum=N*(N-1)/2+M*(M-1)/2 sum N*(N-1)/2+M*(M-1)/2 N*(N-1)/2 N*(N-1) N (N-1) N 1 2 M*(M-1)/2 M*(M-1) M (M-1) M 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) {
		Scanner cin = new Scanner(System.in);
		int N,M;
		int sum=0;
		N=cin.nextInt();
		M=cin.nextInt();
		sum=N*(N-1)/2+M*(M-1)/2;
		System.out.println(sum);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int N,M;
		int sum=0;
		N=cin.nextInt();
		M=cin.nextInt();
		sum=N*(N-1)/2+M*(M-1)/2;
		System.out.println(sum);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int N,M;
		int sum=0;
		N=cin.nextInt();
		M=cin.nextInt();
		sum=N*(N-1)/2+M*(M-1)/2;
		System.out.println(sum);
	}

}
