import java.util.*;
public class Main
{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int n1=0,m1=0,tn1,t;
		if (n>1){
            n=n*(n-1)/2;
            n1+=n;
		}else 
		    n1=0;
		
		if (m>1){
		    m=m*(m-1)/2;
		    m1+=m;
		}else
		    m1=0;
		  
		System.out.println(n1+m1);
		    
	}
} import java.util.*; util.* java public class Main
{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int n1=0,m1=0,tn1,t;
		if (n>1){
            n=n*(n-1)/2;
            n1+=n;
		}else 
		    n1=0;
		
		if (m>1){
		    m=m*(m-1)/2;
		    m1+=m;
		}else
		    m1=0;
		  
		System.out.println(n1+m1);
		    
	}
} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int n1=0,m1=0,tn1,t;
		if (n>1){
            n=n*(n-1)/2;
            n1+=n;
		}else 
		    n1=0;
		
		if (m>1){
		    m=m*(m-1)/2;
		    m1+=m;
		}else
		    m1=0;
		  
		System.out.println(n1+m1);
		    
	} main {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int n1=0,m1=0,tn1,t;
		if (n>1){
            n=n*(n-1)/2;
            n1+=n;
		}else 
		    n1=0;
		
		if (m>1){
		    m=m*(m-1)/2;
		    m1+=m;
		}else
		    m1=0;
		  
		System.out.println(n1+m1);
		    
	} 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 int n1=0 n1 0 m1=0 m1 0 tn1 tn1 t; t if (n>1){
            n=n*(n-1)/2;
            n1+=n;
		}else 
		    n1=0; n>1 n 1 {
            n=n*(n-1)/2;
            n1+=n;
		} n=n*(n-1)/2 n n*(n-1)/2 n*(n-1) n (n-1) n 1 2 n1+=n n1 n n1=0 n1 0 if (m>1){
		    m=m*(m-1)/2;
		    m1+=m;
		}else
		    m1=0; m>1 m 1 {
		    m=m*(m-1)/2;
		    m1+=m;
		} m=m*(m-1)/2 m m*(m-1)/2 m*(m-1) m (m-1) m 1 2 m1+=m m1 m m1=0 m1 0 System.out.println(n1+m1) System.out.println System.out System System.out n1+m1 n1 m1 String[] args args public class Main
{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int n1=0,m1=0,tn1,t;
		if (n>1){
            n=n*(n-1)/2;
            n1+=n;
		}else 
		    n1=0;
		
		if (m>1){
		    m=m*(m-1)/2;
		    m1+=m;
		}else
		    m1=0;
		  
		System.out.println(n1+m1);
		    
	}
} public class Main
{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int n1=0,m1=0,tn1,t;
		if (n>1){
            n=n*(n-1)/2;
            n1+=n;
		}else 
		    n1=0;
		
		if (m>1){
		    m=m*(m-1)/2;
		    m1+=m;
		}else
		    m1=0;
		  
		System.out.println(n1+m1);
		    
	}
} Main
import java.util.*;
public class Main
{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int n1=0,m1=0,tn1,t;
		if (n>1){
            n=n*(n-1)/2;
            n1+=n;
		}else 
		    n1=0;
		
		if (m>1){
		    m=m*(m-1)/2;
		    m1+=m;
		}else
		    m1=0;
		  
		System.out.println(n1+m1);
		    
	}
}
