/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;
public class Main {
	public static void main (String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int m = input.nextInt();
		if(n<=1&&m<=1)
		    System.out.println(0);
		else if(n<=1)
		    System.out.println(binomialCoeff(m,2));
		else if(m<=1)
		    System.out.println(binomialCoeff(n,2));
		else
    		System.out.println(binomialCoeff(n,2)+binomialCoeff(m,2));
		
	}
	static int binomialCoeff(int n, int k) 
    { 
        int res = 1;  
        if ( k > n - k ) 
            k = n - k;  
        for (int i = 0; i < k; ++i) 
        { 
            res *= (n - i); 
            res /= (i + 1); 
        } 
      
        return res; 
    } 
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
	public static void main (String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int m = input.nextInt();
		if(n<=1&&m<=1)
		    System.out.println(0);
		else if(n<=1)
		    System.out.println(binomialCoeff(m,2));
		else if(m<=1)
		    System.out.println(binomialCoeff(n,2));
		else
    		System.out.println(binomialCoeff(n,2)+binomialCoeff(m,2));
		
	}
	static int binomialCoeff(int n, int k) 
    { 
        int res = 1;  
        if ( k > n - k ) 
            k = n - k;  
        for (int i = 0; i < k; ++i) 
        { 
            res *= (n - i); 
            res /= (i + 1); 
        } 
      
        return res; 
    } 
} Main public static void main (String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int m = input.nextInt();
		if(n<=1&&m<=1)
		    System.out.println(0);
		else if(n<=1)
		    System.out.println(binomialCoeff(m,2));
		else if(m<=1)
		    System.out.println(binomialCoeff(n,2));
		else
    		System.out.println(binomialCoeff(n,2)+binomialCoeff(m,2));
		
	} main {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int m = input.nextInt();
		if(n<=1&&m<=1)
		    System.out.println(0);
		else if(n<=1)
		    System.out.println(binomialCoeff(m,2));
		else if(m<=1)
		    System.out.println(binomialCoeff(n,2));
		else
    		System.out.println(binomialCoeff(n,2)+binomialCoeff(m,2));
		
	} Scanner input = new Scanner(System.in); input new Scanner(System.in) int n = input.nextInt(); n input.nextInt() input.nextInt input int m = input.nextInt(); m input.nextInt() input.nextInt input if(n<=1&&m<=1)
		    System.out.println(0);
		else if(n<=1)
		    System.out.println(binomialCoeff(m,2));
		else if(m<=1)
		    System.out.println(binomialCoeff(n,2));
		else
    		System.out.println(binomialCoeff(n,2)+binomialCoeff(m,2)); n<=1&&m<=1 n<=1 n 1 m<=1 m 1 System.out.println(0) System.out.println System.out System System.out 0 if(n<=1)
		    System.out.println(binomialCoeff(m,2));
		else if(m<=1)
		    System.out.println(binomialCoeff(n,2));
		else
    		System.out.println(binomialCoeff(n,2)+binomialCoeff(m,2)); n<=1 n 1 System.out.println(binomialCoeff(m,2)) System.out.println System.out System System.out binomialCoeff(m,2) binomialCoeff m 2 if(m<=1)
		    System.out.println(binomialCoeff(n,2));
		else
    		System.out.println(binomialCoeff(n,2)+binomialCoeff(m,2)); m<=1 m 1 System.out.println(binomialCoeff(n,2)) System.out.println System.out System System.out binomialCoeff(n,2) binomialCoeff n 2 System.out.println(binomialCoeff(n,2)+binomialCoeff(m,2)) System.out.println System.out System System.out binomialCoeff(n,2)+binomialCoeff(m,2) binomialCoeff(n,2) binomialCoeff n 2 binomialCoeff(m,2) binomialCoeff m 2 String[] args args static int binomialCoeff(int n, int k) 
    { 
        int res = 1;  
        if ( k > n - k ) 
            k = n - k;  
        for (int i = 0; i < k; ++i) 
        { 
            res *= (n - i); 
            res /= (i + 1); 
        } 
      
        return res; 
    } binomialCoeff { 
        int res = 1;  
        if ( k > n - k ) 
            k = n - k;  
        for (int i = 0; i < k; ++i) 
        { 
            res *= (n - i); 
            res /= (i + 1); 
        } 
      
        return res; 
    } int res = 1; res 1 if ( k > n - k ) 
            k = n - k; k > n - k k n - k n k k = n - k k n - k n k for (int i = 0; i < k; ++i) 
        { 
            res *= (n - i); 
            res /= (i + 1); 
        } int i = 0; int i = 0; i 0 i < k i k ++i ++i i { 
            res *= (n - i); 
            res /= (i + 1); 
        } { 
            res *= (n - i); 
            res /= (i + 1); 
        } res *= (n - i) res (n - i) n i res /= (i + 1) res (i + 1) i 1 return res; res int n n int k k public class Main {
	public static void main (String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int m = input.nextInt();
		if(n<=1&&m<=1)
		    System.out.println(0);
		else if(n<=1)
		    System.out.println(binomialCoeff(m,2));
		else if(m<=1)
		    System.out.println(binomialCoeff(n,2));
		else
    		System.out.println(binomialCoeff(n,2)+binomialCoeff(m,2));
		
	}
	static int binomialCoeff(int n, int k) 
    { 
        int res = 1;  
        if ( k > n - k ) 
            k = n - k;  
        for (int i = 0; i < k; ++i) 
        { 
            res *= (n - i); 
            res /= (i + 1); 
        } 
      
        return res; 
    } 
} public class Main {
	public static void main (String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int m = input.nextInt();
		if(n<=1&&m<=1)
		    System.out.println(0);
		else if(n<=1)
		    System.out.println(binomialCoeff(m,2));
		else if(m<=1)
		    System.out.println(binomialCoeff(n,2));
		else
    		System.out.println(binomialCoeff(n,2)+binomialCoeff(m,2));
		
	}
	static int binomialCoeff(int n, int k) 
    { 
        int res = 1;  
        if ( k > n - k ) 
            k = n - k;  
        for (int i = 0; i < k; ++i) 
        { 
            res *= (n - i); 
            res /= (i + 1); 
        } 
      
        return res; 
    } 
} Main
/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;
public class Main {
	public static void main (String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int m = input.nextInt();
		if(n<=1&&m<=1)
		    System.out.println(0);
		else if(n<=1)
		    System.out.println(binomialCoeff(m,2));
		else if(m<=1)
		    System.out.println(binomialCoeff(n,2));
		else
    		System.out.println(binomialCoeff(n,2)+binomialCoeff(m,2));
		
	}
	static int binomialCoeff(int n, int k) 
    { 
        int res = 1;  
        if ( k > n - k ) 
            k = n - k;  
        for (int i = 0; i < k; ++i) 
        { 
            res *= (n - i); 
            res /= (i + 1); 
        } 
      
        return res; 
    } 
}