// package app;

import java.util.Arrays;
import java.util.Objects;
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {

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

        // final String S = sc.next();

        final int N = sc.nextInt();
        final int A = sc.nextInt();
        // final long B = sc.nextLong();
        // final String s = sc.next();
        // final String b = sc.next();

        int oddNum = 0;
        int evenNum = 0;
        for (int i = N - 1; i > 0; i--) {
            oddNum += i;
        }
        for (int i = A - 1; i > 0; i--) {
            evenNum += i;
        }
        System.out.println(oddNum + evenNum);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    }
} import java.util.Arrays; Arrays java.util import java.util.Objects; Objects java.util import java.util.Scanner; Scanner java.util import java.util.stream.Stream; Stream java.util.stream public class Main {

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

        // final String S = sc.next();

        final int N = sc.nextInt();
        final int A = sc.nextInt();
        // final long B = sc.nextLong();
        // final String s = sc.next();
        // final String b = sc.next();

        int oddNum = 0;
        int evenNum = 0;
        for (int i = N - 1; i > 0; i--) {
            oddNum += i;
        }
        for (int i = A - 1; i > 0; i--) {
            evenNum += i;
        }
        System.out.println(oddNum + evenNum);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

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

        // final String S = sc.next();

        final int N = sc.nextInt();
        final int A = sc.nextInt();
        // final long B = sc.nextLong();
        // final String s = sc.next();
        // final String b = sc.next();

        int oddNum = 0;
        int evenNum = 0;
        for (int i = N - 1; i > 0; i--) {
            oddNum += i;
        }
        for (int i = A - 1; i > 0; i--) {
            evenNum += i;
        }
        System.out.println(oddNum + evenNum);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

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

        // final String S = sc.next();

        final int N = sc.nextInt();
        final int A = sc.nextInt();
        // final long B = sc.nextLong();
        // final String s = sc.next();
        // final String b = sc.next();

        int oddNum = 0;
        int evenNum = 0;
        for (int i = N - 1; i > 0; i--) {
            oddNum += i;
        }
        for (int i = A - 1; i > 0; i--) {
            evenNum += i;
        }
        System.out.println(oddNum + evenNum);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc final int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int oddNum = 0; oddNum 0 int evenNum = 0; evenNum 0 for (int i = N - 1; i > 0; i--) {
            oddNum += i;
        } int i = N - 1; int i = N - 1; i N - 1 N 1 i > 0 i 0 i-- i-- i {
            oddNum += i;
        } {
            oddNum += i;
        } oddNum += i oddNum i for (int i = A - 1; i > 0; i--) {
            evenNum += i;
        } int i = A - 1; int i = A - 1; i A - 1 A 1 i > 0 i 0 i-- i-- i {
            evenNum += i;
        } {
            evenNum += i;
        } evenNum += i evenNum i System.out.println(oddNum + evenNum) System.out.println System.out System System.out oddNum + evenNum oddNum evenNum final String[] args args public class Main {

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

        // final String S = sc.next();

        final int N = sc.nextInt();
        final int A = sc.nextInt();
        // final long B = sc.nextLong();
        // final String s = sc.next();
        // final String b = sc.next();

        int oddNum = 0;
        int evenNum = 0;
        for (int i = N - 1; i > 0; i--) {
            oddNum += i;
        }
        for (int i = A - 1; i > 0; i--) {
            evenNum += i;
        }
        System.out.println(oddNum + evenNum);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    }
} public class Main {

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

        // final String S = sc.next();

        final int N = sc.nextInt();
        final int A = sc.nextInt();
        // final long B = sc.nextLong();
        // final String s = sc.next();
        // final String b = sc.next();

        int oddNum = 0;
        int evenNum = 0;
        for (int i = N - 1; i > 0; i--) {
            oddNum += i;
        }
        for (int i = A - 1; i > 0; i--) {
            evenNum += i;
        }
        System.out.println(oddNum + evenNum);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    }
} Main
// package app;

import java.util.Arrays;
import java.util.Objects;
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {

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

        // final String S = sc.next();

        final int N = sc.nextInt();
        final int A = sc.nextInt();
        // final long B = sc.nextLong();
        // final String s = sc.next();
        // final String b = sc.next();

        int oddNum = 0;
        int evenNum = 0;
        for (int i = N - 1; i > 0; i--) {
            oddNum += i;
        }
        for (int i = A - 1; i > 0; i--) {
            evenNum += i;
        }
        System.out.println(oddNum + evenNum);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    }
}