import java.util.Scanner;

public class Main {
static Scanner s = new Scanner(System.in);
	public static void main(String[] args) {

		int n = s.nextInt();
		int m = s.nextInt();
		
		int sum =0;
		 if(n==1) {
			 sum+=0;
		 }
		 else
			 sum+=((n)*(n-1))/2;
		 
		 if(m==1)
			 sum+=0;
		 else
			 sum+=((m)*(m-1))/2;
		 
		 System.out.println(sum);

	}

} import java.util.Scanner; Scanner java.util public class Main {
static Scanner s = new Scanner(System.in);
	public static void main(String[] args) {

		int n = s.nextInt();
		int m = s.nextInt();
		
		int sum =0;
		 if(n==1) {
			 sum+=0;
		 }
		 else
			 sum+=((n)*(n-1))/2;
		 
		 if(m==1)
			 sum+=0;
		 else
			 sum+=((m)*(m-1))/2;
		 
		 System.out.println(sum);

	}

} Main static Scanner s = new Scanner(System.in); s new Scanner(System.in) public static void main(String[] args) {

		int n = s.nextInt();
		int m = s.nextInt();
		
		int sum =0;
		 if(n==1) {
			 sum+=0;
		 }
		 else
			 sum+=((n)*(n-1))/2;
		 
		 if(m==1)
			 sum+=0;
		 else
			 sum+=((m)*(m-1))/2;
		 
		 System.out.println(sum);

	} main {

		int n = s.nextInt();
		int m = s.nextInt();
		
		int sum =0;
		 if(n==1) {
			 sum+=0;
		 }
		 else
			 sum+=((n)*(n-1))/2;
		 
		 if(m==1)
			 sum+=0;
		 else
			 sum+=((m)*(m-1))/2;
		 
		 System.out.println(sum);

	} int n = s.nextInt(); n s.nextInt() s.nextInt s int m = s.nextInt(); m s.nextInt() s.nextInt s int sum =0; sum 0 if(n==1) {
			 sum+=0;
		 }
		 else
			 sum+=((n)*(n-1))/2; n==1 n 1 {
			 sum+=0;
		 } sum+=0 sum 0 sum+=((n)*(n-1))/2 sum ((n)*(n-1))/2 ((n)*(n-1)) (n) (n-1) n 1 2 if(m==1)
			 sum+=0;
		 else
			 sum+=((m)*(m-1))/2; m==1 m 1 sum+=0 sum 0 sum+=((m)*(m-1))/2 sum ((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 {
static Scanner s = new Scanner(System.in);
	public static void main(String[] args) {

		int n = s.nextInt();
		int m = s.nextInt();
		
		int sum =0;
		 if(n==1) {
			 sum+=0;
		 }
		 else
			 sum+=((n)*(n-1))/2;
		 
		 if(m==1)
			 sum+=0;
		 else
			 sum+=((m)*(m-1))/2;
		 
		 System.out.println(sum);

	}

} public class Main {
static Scanner s = new Scanner(System.in);
	public static void main(String[] args) {

		int n = s.nextInt();
		int m = s.nextInt();
		
		int sum =0;
		 if(n==1) {
			 sum+=0;
		 }
		 else
			 sum+=((n)*(n-1))/2;
		 
		 if(m==1)
			 sum+=0;
		 else
			 sum+=((m)*(m-1))/2;
		 
		 System.out.println(sum);

	}

} Main
import java.util.Scanner;

public class Main {
static Scanner s = new Scanner(System.in);
	public static void main(String[] args) {

		int n = s.nextInt();
		int m = s.nextInt();
		
		int sum =0;
		 if(n==1) {
			 sum+=0;
		 }
		 else
			 sum+=((n)*(n-1))/2;
		 
		 if(m==1)
			 sum+=0;
		 else
			 sum+=((m)*(m-1))/2;
		 
		 System.out.println(sum);

	}

}
