import java.util.Scanner;

public class Main {

    private static Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {

        solve();
    }

    private static void solve() {

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

        int result = (n * (n - 1)) / 2 + m * (m - 1) / 2;

        System.out.println(result);

    }
} import java.util.Scanner; Scanner java.util public class Main {

    private static Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {

        solve();
    }

    private static void solve() {

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

        int result = (n * (n - 1)) / 2 + m * (m - 1) / 2;

        System.out.println(result);

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

        solve();
    } main {

        solve();
    } solve() solve String[] args args private static void solve() {

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

        int result = (n * (n - 1)) / 2 + m * (m - 1) / 2;

        System.out.println(result);

    } solve {

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

        int result = (n * (n - 1)) / 2 + m * (m - 1) / 2;

        System.out.println(result);

    } int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int m = scanner.nextInt(); m scanner.nextInt() scanner.nextInt scanner int result = (n * (n - 1)) / 2 + m * (m - 1) / 2; result (n * (n - 1)) / 2 + m * (m - 1) / 2 (n * (n - 1)) / 2 (n * (n - 1)) n (n - 1) n 1 2 m * (m - 1) / 2 m * (m - 1) m (m - 1) m 1 2 System.out.println(result) System.out.println System.out System System.out result public class Main {

    private static Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {

        solve();
    }

    private static void solve() {

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

        int result = (n * (n - 1)) / 2 + m * (m - 1) / 2;

        System.out.println(result);

    }
} public class Main {

    private static Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {

        solve();
    }

    private static void solve() {

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

        int result = (n * (n - 1)) / 2 + m * (m - 1) / 2;

        System.out.println(result);

    }
} Main
import java.util.Scanner;

public class Main {

    private static Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {

        solve();
    }

    private static void solve() {

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

        int result = (n * (n - 1)) / 2 + m * (m - 1) / 2;

        System.out.println(result);

    }
}