import java.util.*;

public class Main {
    static long combination(long n,long r)
    {
        long ans=1;
        for(long i=0;i<r;i++)
        {
            ans=(ans*(n-i))/(i+1);
        }
        return ans;
    }
    
    public static void main(String[] args){
    	Scanner sc=new Scanner(System.in);
    	long e=sc.nextLong();
      	long o=sc.nextLong();
      	long ans=0;
      	if(e>=2){
          ans+=combination(e,2);
        }
      	if(o>=2){
          ans+=combination(o,2);
        }
      System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    static long combination(long n,long r)
    {
        long ans=1;
        for(long i=0;i<r;i++)
        {
            ans=(ans*(n-i))/(i+1);
        }
        return ans;
    }
    
    public static void main(String[] args){
    	Scanner sc=new Scanner(System.in);
    	long e=sc.nextLong();
      	long o=sc.nextLong();
      	long ans=0;
      	if(e>=2){
          ans+=combination(e,2);
        }
      	if(o>=2){
          ans+=combination(o,2);
        }
      System.out.println(ans);
    }
} Main static long combination(long n,long r)
    {
        long ans=1;
        for(long i=0;i<r;i++)
        {
            ans=(ans*(n-i))/(i+1);
        }
        return ans;
    } combination {
        long ans=1;
        for(long i=0;i<r;i++)
        {
            ans=(ans*(n-i))/(i+1);
        }
        return ans;
    } long ans=1; ans 1 for(long i=0;i<r;i++)
        {
            ans=(ans*(n-i))/(i+1);
        } long i=0; long i=0; i 0 i<r i r i++ i++ i {
            ans=(ans*(n-i))/(i+1);
        } {
            ans=(ans*(n-i))/(i+1);
        } ans=(ans*(n-i))/(i+1) ans (ans*(n-i))/(i+1) (ans*(n-i)) ans (n-i) n i (i+1) i 1 return ans; ans long n n long r r public static void main(String[] args){
    	Scanner sc=new Scanner(System.in);
    	long e=sc.nextLong();
      	long o=sc.nextLong();
      	long ans=0;
      	if(e>=2){
          ans+=combination(e,2);
        }
      	if(o>=2){
          ans+=combination(o,2);
        }
      System.out.println(ans);
    } main {
    	Scanner sc=new Scanner(System.in);
    	long e=sc.nextLong();
      	long o=sc.nextLong();
      	long ans=0;
      	if(e>=2){
          ans+=combination(e,2);
        }
      	if(o>=2){
          ans+=combination(o,2);
        }
      System.out.println(ans);
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) long e=sc.nextLong(); e sc.nextLong() sc.nextLong sc long o=sc.nextLong(); o sc.nextLong() sc.nextLong sc long ans=0; ans 0 if(e>=2){
          ans+=combination(e,2);
        } e>=2 e 2 {
          ans+=combination(e,2);
        } ans+=combination(e,2) ans combination(e,2) combination e 2 if(o>=2){
          ans+=combination(o,2);
        } o>=2 o 2 {
          ans+=combination(o,2);
        } ans+=combination(o,2) ans combination(o,2) combination o 2 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    static long combination(long n,long r)
    {
        long ans=1;
        for(long i=0;i<r;i++)
        {
            ans=(ans*(n-i))/(i+1);
        }
        return ans;
    }
    
    public static void main(String[] args){
    	Scanner sc=new Scanner(System.in);
    	long e=sc.nextLong();
      	long o=sc.nextLong();
      	long ans=0;
      	if(e>=2){
          ans+=combination(e,2);
        }
      	if(o>=2){
          ans+=combination(o,2);
        }
      System.out.println(ans);
    }
} public class Main {
    static long combination(long n,long r)
    {
        long ans=1;
        for(long i=0;i<r;i++)
        {
            ans=(ans*(n-i))/(i+1);
        }
        return ans;
    }
    
    public static void main(String[] args){
    	Scanner sc=new Scanner(System.in);
    	long e=sc.nextLong();
      	long o=sc.nextLong();
      	long ans=0;
      	if(e>=2){
          ans+=combination(e,2);
        }
      	if(o>=2){
          ans+=combination(o,2);
        }
      System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {
    static long combination(long n,long r)
    {
        long ans=1;
        for(long i=0;i<r;i++)
        {
            ans=(ans*(n-i))/(i+1);
        }
        return ans;
    }
    
    public static void main(String[] args){
    	Scanner sc=new Scanner(System.in);
    	long e=sc.nextLong();
      	long o=sc.nextLong();
      	long ans=0;
      	if(e>=2){
          ans+=combination(e,2);
        }
      	if(o>=2){
          ans+=combination(o,2);
        }
      System.out.println(ans);
    }
}
