
import java.util.*;

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

import java.util.*;

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