import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		sc.close();

		if(N != 0 && M != 0) {
			int answer = N * (N - 1) / 2 + M * (M - 1)/2;
			System.out.println(answer);
		}else if( N == 0) {
			System.out.println(M * (M - 1)/2);
		}else if( M == 0) {
			System.out.println(N * (N - 1)/2);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		sc.close();

		if(N != 0 && M != 0) {
			int answer = N * (N - 1) / 2 + M * (M - 1)/2;
			System.out.println(answer);
		}else if( N == 0) {
			System.out.println(M * (M - 1)/2);
		}else if( M == 0) {
			System.out.println(N * (N - 1)/2);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		sc.close();

		if(N != 0 && M != 0) {
			int answer = N * (N - 1) / 2 + M * (M - 1)/2;
			System.out.println(answer);
		}else if( N == 0) {
			System.out.println(M * (M - 1)/2);
		}else if( M == 0) {
			System.out.println(N * (N - 1)/2);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		sc.close();

		if(N != 0 && M != 0) {
			int answer = N * (N - 1) / 2 + M * (M - 1)/2;
			System.out.println(answer);
		}else if( N == 0) {
			System.out.println(M * (M - 1)/2);
		}else if( M == 0) {
			System.out.println(N * (N - 1)/2);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int M = Integer.parseInt(sc.next()); M Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc if(N != 0 && M != 0) {
			int answer = N * (N - 1) / 2 + M * (M - 1)/2;
			System.out.println(answer);
		}else if( N == 0) {
			System.out.println(M * (M - 1)/2);
		}else if( M == 0) {
			System.out.println(N * (N - 1)/2);
		} N != 0 && M != 0 N != 0 N 0 M != 0 M 0 {
			int answer = N * (N - 1) / 2 + M * (M - 1)/2;
			System.out.println(answer);
		} int answer = N * (N - 1) / 2 + M * (M - 1)/2; answer 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(answer) System.out.println System.out System System.out answer if( N == 0) {
			System.out.println(M * (M - 1)/2);
		}else if( M == 0) {
			System.out.println(N * (N - 1)/2);
		} N == 0 N 0 {
			System.out.println(M * (M - 1)/2);
		} System.out.println(M * (M - 1)/2) System.out.println System.out System System.out M * (M - 1)/2 M * (M - 1) M (M - 1) M 1 2 if( M == 0) {
			System.out.println(N * (N - 1)/2);
		} M == 0 M 0 {
			System.out.println(N * (N - 1)/2);
		} System.out.println(N * (N - 1)/2) System.out.println System.out System System.out N * (N - 1)/2 N * (N - 1) N (N - 1) N 1 2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		sc.close();

		if(N != 0 && M != 0) {
			int answer = N * (N - 1) / 2 + M * (M - 1)/2;
			System.out.println(answer);
		}else if( N == 0) {
			System.out.println(M * (M - 1)/2);
		}else if( M == 0) {
			System.out.println(N * (N - 1)/2);
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		sc.close();

		if(N != 0 && M != 0) {
			int answer = N * (N - 1) / 2 + M * (M - 1)/2;
			System.out.println(answer);
		}else if( N == 0) {
			System.out.println(M * (M - 1)/2);
		}else if( M == 0) {
			System.out.println(N * (N - 1)/2);
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		sc.close();

		if(N != 0 && M != 0) {
			int answer = N * (N - 1) / 2 + M * (M - 1)/2;
			System.out.println(answer);
		}else if( N == 0) {
			System.out.println(M * (M - 1)/2);
		}else if( M == 0) {
			System.out.println(N * (N - 1)/2);
		}
	}
}