import java.util.Scanner;

public class Main {
    public int evenPatternCount (int num) {
        int count = 0;
        for (int i = num - 1; i >= 1; i--) {
            count += i;
        }

        return count;
    }

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

        int N = sc.nextInt();
        int M = sc.nextInt();
        int evenCount = 0;

        evenCount += MyClass.evenPatternCount(N);
        evenCount += MyClass.evenPatternCount(M);

        System.out.println(evenCount);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public int evenPatternCount (int num) {
        int count = 0;
        for (int i = num - 1; i >= 1; i--) {
            count += i;
        }

        return count;
    }

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

        int N = sc.nextInt();
        int M = sc.nextInt();
        int evenCount = 0;

        evenCount += MyClass.evenPatternCount(N);
        evenCount += MyClass.evenPatternCount(M);

        System.out.println(evenCount);
    }
} Main public int evenPatternCount (int num) {
        int count = 0;
        for (int i = num - 1; i >= 1; i--) {
            count += i;
        }

        return count;
    } evenPatternCount {
        int count = 0;
        for (int i = num - 1; i >= 1; i--) {
            count += i;
        }

        return count;
    } int count = 0; count 0 for (int i = num - 1; i >= 1; i--) {
            count += i;
        } int i = num - 1; int i = num - 1; i num - 1 num 1 i >= 1 i 1 i-- i-- i {
            count += i;
        } {
            count += i;
        } count += i count i return count; count int num num public static void main(String[] args) {
        Main MyClass = new Main();
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();
        int evenCount = 0;

        evenCount += MyClass.evenPatternCount(N);
        evenCount += MyClass.evenPatternCount(M);

        System.out.println(evenCount);
    } main {
        Main MyClass = new Main();
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();
        int evenCount = 0;

        evenCount += MyClass.evenPatternCount(N);
        evenCount += MyClass.evenPatternCount(M);

        System.out.println(evenCount);
    } Main MyClass = new Main(); MyClass new Main() Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int M = sc.nextInt(); M sc.nextInt() sc.nextInt sc int evenCount = 0; evenCount 0 evenCount += MyClass.evenPatternCount(N) evenCount MyClass.evenPatternCount(N) MyClass.evenPatternCount MyClass N evenCount += MyClass.evenPatternCount(M) evenCount MyClass.evenPatternCount(M) MyClass.evenPatternCount MyClass M System.out.println(evenCount) System.out.println System.out System System.out evenCount String[] args args public class Main {
    public int evenPatternCount (int num) {
        int count = 0;
        for (int i = num - 1; i >= 1; i--) {
            count += i;
        }

        return count;
    }

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

        int N = sc.nextInt();
        int M = sc.nextInt();
        int evenCount = 0;

        evenCount += MyClass.evenPatternCount(N);
        evenCount += MyClass.evenPatternCount(M);

        System.out.println(evenCount);
    }
} public class Main {
    public int evenPatternCount (int num) {
        int count = 0;
        for (int i = num - 1; i >= 1; i--) {
            count += i;
        }

        return count;
    }

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

        int N = sc.nextInt();
        int M = sc.nextInt();
        int evenCount = 0;

        evenCount += MyClass.evenPatternCount(N);
        evenCount += MyClass.evenPatternCount(M);

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

public class Main {
    public int evenPatternCount (int num) {
        int count = 0;
        for (int i = num - 1; i >= 1; i--) {
            count += i;
        }

        return count;
    }

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

        int N = sc.nextInt();
        int M = sc.nextInt();
        int evenCount = 0;

        evenCount += MyClass.evenPatternCount(N);
        evenCount += MyClass.evenPatternCount(M);

        System.out.println(evenCount);
    }
}