import java.util.*;
import java.io.*;
import java.lang.*;

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

        int n = sc.nextInt();
        int m = sc.nextInt();

        int c = (n*(n-1))/2;
        int d = (m*(m-1))/2;

        System.out.println(c+d);

    }
}
 import java.util.*; util.* java import java.io.*; io.* java import java.lang.*; lang.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        int c = (n*(n-1))/2;
        int d = (m*(m-1))/2;

        System.out.println(c+d);

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

        int n = sc.nextInt();
        int m = sc.nextInt();

        int c = (n*(n-1))/2;
        int d = (m*(m-1))/2;

        System.out.println(c+d);

    } main {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        int c = (n*(n-1))/2;
        int d = (m*(m-1))/2;

        System.out.println(c+d);

    } 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 c = (n*(n-1))/2; c (n*(n-1))/2 (n*(n-1)) n (n-1) n 1 2 int d = (m*(m-1))/2; d (m*(m-1))/2 (m*(m-1)) m (m-1) m 1 2 System.out.println(c+d) System.out.println System.out System System.out c+d c d 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 c = (n*(n-1))/2;
        int d = (m*(m-1))/2;

        System.out.println(c+d);

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

        int n = sc.nextInt();
        int m = sc.nextInt();

        int c = (n*(n-1))/2;
        int d = (m*(m-1))/2;

        System.out.println(c+d);

    }
} Main
import java.util.*;
import java.io.*;
import java.lang.*;

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

        int n = sc.nextInt();
        int m = sc.nextInt();

        int c = (n*(n-1))/2;
        int d = (m*(m-1))/2;

        System.out.println(c+d);

    }
}

