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(); //奇数球
        System.out.println(choose(n, 2) + choose(m, 2));

    }

    static int choose (int n, int k){
        int ret = 1;
        if(n == k) {
            return 1;
        }else {
            for(int i = 0; i < k; i++){
                ret = ret * (n-i) / (i + 1);
            }
        return ret;}
    }
} 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(); //奇数球
        System.out.println(choose(n, 2) + choose(m, 2));

    }

    static int choose (int n, int k){
        int ret = 1;
        if(n == k) {
            return 1;
        }else {
            for(int i = 0; i < k; i++){
                ret = ret * (n-i) / (i + 1);
            }
        return ret;}
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(); //偶数球
        int m = sc.nextInt(); //奇数球
        System.out.println(choose(n, 2) + choose(m, 2));

    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(); //偶数球
        int m = sc.nextInt(); //奇数球
        System.out.println(choose(n, 2) + choose(m, 2));

    } 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 System.out.println(choose(n, 2) + choose(m, 2)) System.out.println System.out System System.out choose(n, 2) + choose(m, 2) choose(n, 2) choose n 2 choose(m, 2) choose m 2 String[] args args static int choose (int n, int k){
        int ret = 1;
        if(n == k) {
            return 1;
        }else {
            for(int i = 0; i < k; i++){
                ret = ret * (n-i) / (i + 1);
            }
        return ret;}
    } choose {
        int ret = 1;
        if(n == k) {
            return 1;
        }else {
            for(int i = 0; i < k; i++){
                ret = ret * (n-i) / (i + 1);
            }
        return ret;}
    } int ret = 1; ret 1 if(n == k) {
            return 1;
        }else {
            for(int i = 0; i < k; i++){
                ret = ret * (n-i) / (i + 1);
            }
        return ret;} n == k n k {
            return 1;
        } return 1; 1 {
            for(int i = 0; i < k; i++){
                ret = ret * (n-i) / (i + 1);
            }
        return ret;} for(int i = 0; i < k; i++){
                ret = ret * (n-i) / (i + 1);
            } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
                ret = ret * (n-i) / (i + 1);
            } {
                ret = ret * (n-i) / (i + 1);
            } ret = ret * (n-i) / (i + 1) ret ret * (n-i) / (i + 1) ret * (n-i) ret (n-i) n i (i + 1) i 1 return ret; ret int n n int k k public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(); //偶数球
        int m = sc.nextInt(); //奇数球
        System.out.println(choose(n, 2) + choose(m, 2));

    }

    static int choose (int n, int k){
        int ret = 1;
        if(n == k) {
            return 1;
        }else {
            for(int i = 0; i < k; i++){
                ret = ret * (n-i) / (i + 1);
            }
        return ret;}
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(); //偶数球
        int m = sc.nextInt(); //奇数球
        System.out.println(choose(n, 2) + choose(m, 2));

    }

    static int choose (int n, int k){
        int ret = 1;
        if(n == k) {
            return 1;
        }else {
            for(int i = 0; i < k; i++){
                ret = ret * (n-i) / (i + 1);
            }
        return ret;}
    }
} 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(); //奇数球
        System.out.println(choose(n, 2) + choose(m, 2));

    }

    static int choose (int n, int k){
        int ret = 1;
        if(n == k) {
            return 1;
        }else {
            for(int i = 0; i < k; i++){
                ret = ret * (n-i) / (i + 1);
            }
        return ret;}
    }
}