import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int ans = 0; 
		ans = (n*(n-1))/2 + (m*(m-1))/2;
		
		System.out.println(ans);
		scan.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int ans = 0; 
		ans = (n*(n-1))/2 + (m*(m-1))/2;
		
		System.out.println(ans);
		scan.close();
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int ans = 0; 
		ans = (n*(n-1))/2 + (m*(m-1))/2;
		
		System.out.println(ans);
		scan.close();
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int ans = 0; 
		ans = (n*(n-1))/2 + (m*(m-1))/2;
		
		System.out.println(ans);
		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int m = scan.nextInt(); m scan.nextInt() scan.nextInt scan int ans = 0; ans 0 ans = (n*(n-1))/2 + (m*(m-1))/2 ans (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(ans) System.out.println System.out System System.out ans scan.close() scan.close scan String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int ans = 0; 
		ans = (n*(n-1))/2 + (m*(m-1))/2;
		
		System.out.println(ans);
		scan.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int ans = 0; 
		ans = (n*(n-1))/2 + (m*(m-1))/2;
		
		System.out.println(ans);
		scan.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int ans = 0; 
		ans = (n*(n-1))/2 + (m*(m-1))/2;
		
		System.out.println(ans);
		scan.close();
	}
}