import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int sum1= n*(n-1)/2;
        int sum2 = m*(m-1)/2;
        System.out.println(sum1+sum2);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int sum1= n*(n-1)/2;
        int sum2 = m*(m-1)/2;
        System.out.println(sum1+sum2);
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int sum1= n*(n-1)/2;
        int sum2 = m*(m-1)/2;
        System.out.println(sum1+sum2);
    } main {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int sum1= n*(n-1)/2;
        int sum2 = m*(m-1)/2;
        System.out.println(sum1+sum2);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int m = in.nextInt(); m in.nextInt() in.nextInt in int sum1= n*(n-1)/2; sum1 n*(n-1)/2 n*(n-1) n (n-1) n 1 2 int sum2 = m*(m-1)/2; sum2 m*(m-1)/2 m*(m-1) m (m-1) m 1 2 System.out.println(sum1+sum2) System.out.println System.out System System.out sum1+sum2 sum1 sum2 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int sum1= n*(n-1)/2;
        int sum2 = m*(m-1)/2;
        System.out.println(sum1+sum2);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int sum1= n*(n-1)/2;
        int sum2 = m*(m-1)/2;
        System.out.println(sum1+sum2);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int sum1= n*(n-1)/2;
        int sum2 = m*(m-1)/2;
        System.out.println(sum1+sum2);
    }
}
