import java.util.Scanner;

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

        int N = sc.nextInt();
        int M = sc.nextInt();
        
        //int sum=(N+M)*(N+M-1)/2;
        int even,odd;
        
        if (N>=2) {
            even=N*(N-1)/2;
        } else {
            even=0;
        }
        
        if (M>=2) {
            odd=M*(M-1)/2;
        } else {
            odd=0;
        }   
        
        System.out.println(odd+even);
    }
} import java.util.Scanner; Scanner 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 sum=(N+M)*(N+M-1)/2;
        int even,odd;
        
        if (N>=2) {
            even=N*(N-1)/2;
        } else {
            even=0;
        }
        
        if (M>=2) {
            odd=M*(M-1)/2;
        } else {
            odd=0;
        }   
        
        System.out.println(odd+even);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();
        
        //int sum=(N+M)*(N+M-1)/2;
        int even,odd;
        
        if (N>=2) {
            even=N*(N-1)/2;
        } else {
            even=0;
        }
        
        if (M>=2) {
            odd=M*(M-1)/2;
        } else {
            odd=0;
        }   
        
        System.out.println(odd+even);
    } main {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();
        
        //int sum=(N+M)*(N+M-1)/2;
        int even,odd;
        
        if (N>=2) {
            even=N*(N-1)/2;
        } else {
            even=0;
        }
        
        if (M>=2) {
            odd=M*(M-1)/2;
        } else {
            odd=0;
        }   
        
        System.out.println(odd+even);
    } 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 even even odd; odd if (N>=2) {
            even=N*(N-1)/2;
        } else {
            even=0;
        } N>=2 N 2 {
            even=N*(N-1)/2;
        } even=N*(N-1)/2 even N*(N-1)/2 N*(N-1) N (N-1) N 1 2 {
            even=0;
        } even=0 even 0 if (M>=2) {
            odd=M*(M-1)/2;
        } else {
            odd=0;
        } M>=2 M 2 {
            odd=M*(M-1)/2;
        } odd=M*(M-1)/2 odd M*(M-1)/2 M*(M-1) M (M-1) M 1 2 {
            odd=0;
        } odd=0 odd 0 System.out.println(odd+even) System.out.println System.out System System.out odd+even odd even 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 sum=(N+M)*(N+M-1)/2;
        int even,odd;
        
        if (N>=2) {
            even=N*(N-1)/2;
        } else {
            even=0;
        }
        
        if (M>=2) {
            odd=M*(M-1)/2;
        } else {
            odd=0;
        }   
        
        System.out.println(odd+even);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();
        
        //int sum=(N+M)*(N+M-1)/2;
        int even,odd;
        
        if (N>=2) {
            even=N*(N-1)/2;
        } else {
            even=0;
        }
        
        if (M>=2) {
            odd=M*(M-1)/2;
        } else {
            odd=0;
        }   
        
        System.out.println(odd+even);
    }
} Main
import java.util.Scanner;

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

        int N = sc.nextInt();
        int M = sc.nextInt();
        
        //int sum=(N+M)*(N+M-1)/2;
        int even,odd;
        
        if (N>=2) {
            even=N*(N-1)/2;
        } else {
            even=0;
        }
        
        if (M>=2) {
            odd=M*(M-1)/2;
        } else {
            odd=0;
        }   
        
        System.out.println(odd+even);
    }
}