import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer n = Integer.parseInt(scanner.next());
        Integer m = Integer.parseInt(scanner.next());
        int total = 0;

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

        System.out.println(total);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer n = Integer.parseInt(scanner.next());
        Integer m = Integer.parseInt(scanner.next());
        int total = 0;

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

        System.out.println(total);
    }
} Main public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer n = Integer.parseInt(scanner.next());
        Integer m = Integer.parseInt(scanner.next());
        int total = 0;

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

        System.out.println(total);
    } main {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer n = Integer.parseInt(scanner.next());
        Integer m = Integer.parseInt(scanner.next());
        int total = 0;

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

        System.out.println(total);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) Integer n = Integer.parseInt(scanner.next()); n Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner Integer m = Integer.parseInt(scanner.next()); m Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner int total = 0; total 0 total += (n * (n-1) / 2) total (n * (n-1) / 2) n * (n-1) n (n-1) n 1 2 total += (m * (m-1) / 2) total (m * (m-1) / 2) m * (m-1) m (m-1) m 1 2 System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer n = Integer.parseInt(scanner.next());
        Integer m = Integer.parseInt(scanner.next());
        int total = 0;

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

        System.out.println(total);
    }
} public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer n = Integer.parseInt(scanner.next());
        Integer m = Integer.parseInt(scanner.next());
        int total = 0;

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

        System.out.println(total);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer n = Integer.parseInt(scanner.next());
        Integer m = Integer.parseInt(scanner.next());
        int total = 0;

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

        System.out.println(total);
    }
}