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

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long M;
        M = sc.nextLong();

        final Solver solver = new Solver();
        solver.solve(N, M);
    }
}

class Solver {
    public void solve(long N, long M) {
        long ans = N * (N - 1) / 2;
        ans += M * (M - 1) / 2;
        System.out.println(ans);
    }
}
 import java.io.*; io.* java import java.util.*; util.* java public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long M;
        M = sc.nextLong();

        final Solver solver = new Solver();
        solver.solve(N, M);
    }
} Main public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long M;
        M = sc.nextLong();

        final Solver solver = new Solver();
        solver.solve(N, M);
    } main {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long M;
        M = sc.nextLong();

        final Solver solver = new Solver();
        solver.solve(N, M);
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N; N N = sc.nextLong() N sc.nextLong() sc.nextLong sc long M; M M = sc.nextLong() M sc.nextLong() sc.nextLong sc final Solver solver = new Solver(); solver new Solver() solver.solve(N, M) solver.solve solver N M final String[] args args class Solver {
    public void solve(long N, long M) {
        long ans = N * (N - 1) / 2;
        ans += M * (M - 1) / 2;
        System.out.println(ans);
    }
} Solver public void solve(long N, long M) {
        long ans = N * (N - 1) / 2;
        ans += M * (M - 1) / 2;
        System.out.println(ans);
    } solve {
        long ans = N * (N - 1) / 2;
        ans += M * (M - 1) / 2;
        System.out.println(ans);
    } long ans = N * (N - 1) / 2; ans N * (N - 1) / 2 N * (N - 1) N (N - 1) N 1 2 ans += M * (M - 1) / 2 ans M * (M - 1) / 2 M * (M - 1) M (M - 1) M 1 2 System.out.println(ans) System.out.println System.out System System.out ans long N N long M M public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long M;
        M = sc.nextLong();

        final Solver solver = new Solver();
        solver.solve(N, M);
    }
} public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long M;
        M = sc.nextLong();

        final Solver solver = new Solver();
        solver.solve(N, M);
    }
} Main
import java.io.*;
import java.util.*;

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long M;
        M = sc.nextLong();

        final Solver solver = new Solver();
        solver.solve(N, M);
    }
}

class Solver {
    public void solve(long N, long M) {
        long ans = N * (N - 1) / 2;
        ans += M * (M - 1) / 2;
        System.out.println(ans);
    }
}

