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();
        System.out.println(combi(n) + combi(m));
    }

    static int combi(int a) {
        if(a == 1 || a == 0) {
            return 0;
        }else if(a == 2) {
            return 1;
        }else {
            return a * (a-1) / 2;
        }
    }
} 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();
        System.out.println(combi(n) + combi(m));
    }

    static int combi(int a) {
        if(a == 1 || a == 0) {
            return 0;
        }else if(a == 2) {
            return 1;
        }else {
            return a * (a-1) / 2;
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        System.out.println(combi(n) + combi(m));
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        System.out.println(combi(n) + combi(m));
    } 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(combi(n) + combi(m)) System.out.println System.out System System.out combi(n) + combi(m) combi(n) combi n combi(m) combi m String[] args args static int combi(int a) {
        if(a == 1 || a == 0) {
            return 0;
        }else if(a == 2) {
            return 1;
        }else {
            return a * (a-1) / 2;
        }
    } combi {
        if(a == 1 || a == 0) {
            return 0;
        }else if(a == 2) {
            return 1;
        }else {
            return a * (a-1) / 2;
        }
    } if(a == 1 || a == 0) {
            return 0;
        }else if(a == 2) {
            return 1;
        }else {
            return a * (a-1) / 2;
        } a == 1 || a == 0 a == 1 a 1 a == 0 a 0 {
            return 0;
        } return 0; 0 if(a == 2) {
            return 1;
        }else {
            return a * (a-1) / 2;
        } a == 2 a 2 {
            return 1;
        } return 1; 1 {
            return a * (a-1) / 2;
        } return a * (a-1) / 2; a * (a-1) / 2 a * (a-1) a (a-1) a 1 2 int a a 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(combi(n) + combi(m));
    }

    static int combi(int a) {
        if(a == 1 || a == 0) {
            return 0;
        }else if(a == 2) {
            return 1;
        }else {
            return a * (a-1) / 2;
        }
    }
} 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(combi(n) + combi(m));
    }

    static int combi(int a) {
        if(a == 1 || a == 0) {
            return 0;
        }else if(a == 2) {
            return 1;
        }else {
            return a * (a-1) / 2;
        }
    }
} 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();
        System.out.println(combi(n) + combi(m));
    }

    static int combi(int a) {
        if(a == 1 || a == 0) {
            return 0;
        }else if(a == 2) {
            return 1;
        }else {
            return a * (a-1) / 2;
        }
    }
}