import java.util.*;

class Main {
    public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        do_(inp);
        inp.close();
    }
    public static void do_(Scanner inp) {
        int a = inp.nextInt();
        int b = inp.nextInt();
        int ans = a * (a - 1) / 2 + b * (b - 1) / 2;
        System.out.println(ans);
    }
} import java.util.*; util.* java class Main {
    public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        do_(inp);
        inp.close();
    }
    public static void do_(Scanner inp) {
        int a = inp.nextInt();
        int b = inp.nextInt();
        int ans = a * (a - 1) / 2 + b * (b - 1) / 2;
        System.out.println(ans);
    }
} Main public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        do_(inp);
        inp.close();
    } main {
        Scanner inp = new Scanner(System.in);
        do_(inp);
        inp.close();
    } Scanner inp = new Scanner(System.in); inp new Scanner(System.in) do_(inp) do_ inp inp.close() inp.close inp String args[] args public static void do_(Scanner inp) {
        int a = inp.nextInt();
        int b = inp.nextInt();
        int ans = a * (a - 1) / 2 + b * (b - 1) / 2;
        System.out.println(ans);
    } do_ {
        int a = inp.nextInt();
        int b = inp.nextInt();
        int ans = a * (a - 1) / 2 + b * (b - 1) / 2;
        System.out.println(ans);
    } int a = inp.nextInt(); a inp.nextInt() inp.nextInt inp int b = inp.nextInt(); b inp.nextInt() inp.nextInt inp int ans = a * (a - 1) / 2 + b * (b - 1) / 2; ans a * (a - 1) / 2 + b * (b - 1) / 2 a * (a - 1) / 2 a * (a - 1) a (a - 1) a 1 2 b * (b - 1) / 2 b * (b - 1) b (b - 1) b 1 2 System.out.println(ans) System.out.println System.out System System.out ans Scanner inp inp
import java.util.*;

class Main {
    public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        do_(inp);
        inp.close();
    }
    public static void do_(Scanner inp) {
        int a = inp.nextInt();
        int b = inp.nextInt();
        int ans = a * (a - 1) / 2 + b * (b - 1) / 2;
        System.out.println(ans);
    }
}
