import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		int m = scn.nextInt();
		int val1=n*(n-1)/2;
		val1+=m*(m-1)/2;
		System.out.println(val1);

	}

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

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		int m = scn.nextInt();
		int val1=n*(n-1)/2;
		val1+=m*(m-1)/2;
		System.out.println(val1);

	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		int m = scn.nextInt();
		int val1=n*(n-1)/2;
		val1+=m*(m-1)/2;
		System.out.println(val1);

	} main {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		int m = scn.nextInt();
		int val1=n*(n-1)/2;
		val1+=m*(m-1)/2;
		System.out.println(val1);

	} Scanner scn=new Scanner(System.in); scn new Scanner(System.in) int n=scn.nextInt(); n scn.nextInt() scn.nextInt scn int m = scn.nextInt(); m scn.nextInt() scn.nextInt scn int val1=n*(n-1)/2; val1 n*(n-1)/2 n*(n-1) n (n-1) n 1 2 val1+=m*(m-1)/2 val1 m*(m-1)/2 m*(m-1) m (m-1) m 1 2 System.out.println(val1) System.out.println System.out System System.out val1 String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		int m = scn.nextInt();
		int val1=n*(n-1)/2;
		val1+=m*(m-1)/2;
		System.out.println(val1);

	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		int m = scn.nextInt();
		int val1=n*(n-1)/2;
		val1+=m*(m-1)/2;
		System.out.println(val1);

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		int m = scn.nextInt();
		int val1=n*(n-1)/2;
		val1+=m*(m-1)/2;
		System.out.println(val1);

	}

}