import java.util.Scanner;

public class Main {
    public static int N, M;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        N = sc.nextInt();
        M = sc.nextInt();
        System.out.println(to_hop(N) + to_hop(M));
    }
    public static int to_hop(int temp)
    {
         return (temp*(temp-1)) / 2;

    }

} import java.util.Scanner; Scanner java.util public class Main {
    public static int N, M;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        N = sc.nextInt();
        M = sc.nextInt();
        System.out.println(to_hop(N) + to_hop(M));
    }
    public static int to_hop(int temp)
    {
         return (temp*(temp-1)) / 2;

    }

} Main public static int N N M; M public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        N = sc.nextInt();
        M = sc.nextInt();
        System.out.println(to_hop(N) + to_hop(M));
    } main {
        Scanner sc = new Scanner(System.in);
        N = sc.nextInt();
        M = sc.nextInt();
        System.out.println(to_hop(N) + to_hop(M));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) N = sc.nextInt() N sc.nextInt() sc.nextInt sc M = sc.nextInt() M sc.nextInt() sc.nextInt sc System.out.println(to_hop(N) + to_hop(M)) System.out.println System.out System System.out to_hop(N) + to_hop(M) to_hop(N) to_hop N to_hop(M) to_hop M String[] args args public static int to_hop(int temp)
    {
         return (temp*(temp-1)) / 2;

    } to_hop {
         return (temp*(temp-1)) / 2;

    } return (temp*(temp-1)) / 2; (temp*(temp-1)) / 2 (temp*(temp-1)) temp (temp-1) temp 1 2 int temp temp public class Main {
    public static int N, M;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        N = sc.nextInt();
        M = sc.nextInt();
        System.out.println(to_hop(N) + to_hop(M));
    }
    public static int to_hop(int temp)
    {
         return (temp*(temp-1)) / 2;

    }

} public class Main {
    public static int N, M;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        N = sc.nextInt();
        M = sc.nextInt();
        System.out.println(to_hop(N) + to_hop(M));
    }
    public static int to_hop(int temp)
    {
         return (temp*(temp-1)) / 2;

    }

} Main
import java.util.Scanner;

public class Main {
    public static int N, M;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        N = sc.nextInt();
        M = sc.nextInt();
        System.out.println(to_hop(N) + to_hop(M));
    }
    public static int to_hop(int temp)
    {
         return (temp*(temp-1)) / 2;

    }

}
