
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int evenCount = sc.nextInt();
        int oddCount = sc.nextInt();

        int evenComb = comb(evenCount);
        int oddComb = comb(oddCount);

        System.out.println(evenComb + oddComb);
    }

    static int comb(int a) {
        if (a < 2) {
            return 0;
        }

        return (a * (a - 1)) / 2;
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int evenCount = sc.nextInt();
        int oddCount = sc.nextInt();

        int evenComb = comb(evenCount);
        int oddComb = comb(oddCount);

        System.out.println(evenComb + oddComb);
    }

    static int comb(int a) {
        if (a < 2) {
            return 0;
        }

        return (a * (a - 1)) / 2;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int evenCount = sc.nextInt();
        int oddCount = sc.nextInt();

        int evenComb = comb(evenCount);
        int oddComb = comb(oddCount);

        System.out.println(evenComb + oddComb);
    } main {
        Scanner sc = new Scanner(System.in);
        int evenCount = sc.nextInt();
        int oddCount = sc.nextInt();

        int evenComb = comb(evenCount);
        int oddComb = comb(oddCount);

        System.out.println(evenComb + oddComb);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int evenCount = sc.nextInt(); evenCount sc.nextInt() sc.nextInt sc int oddCount = sc.nextInt(); oddCount sc.nextInt() sc.nextInt sc int evenComb = comb(evenCount); evenComb comb(evenCount) comb evenCount int oddComb = comb(oddCount); oddComb comb(oddCount) comb oddCount System.out.println(evenComb + oddComb) System.out.println System.out System System.out evenComb + oddComb evenComb oddComb String[] args args static int comb(int a) {
        if (a < 2) {
            return 0;
        }

        return (a * (a - 1)) / 2;
    } comb {
        if (a < 2) {
            return 0;
        }

        return (a * (a - 1)) / 2;
    } if (a < 2) {
            return 0;
        } a < 2 a 2 {
            return 0;
        } return 0; 0 return (a * (a - 1)) / 2; (a * (a - 1)) / 2 (a * (a - 1)) a (a - 1) a 1 2 int a a public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int evenCount = sc.nextInt();
        int oddCount = sc.nextInt();

        int evenComb = comb(evenCount);
        int oddComb = comb(oddCount);

        System.out.println(evenComb + oddComb);
    }

    static int comb(int a) {
        if (a < 2) {
            return 0;
        }

        return (a * (a - 1)) / 2;
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int evenCount = sc.nextInt();
        int oddCount = sc.nextInt();

        int evenComb = comb(evenCount);
        int oddComb = comb(oddCount);

        System.out.println(evenComb + oddComb);
    }

    static int comb(int a) {
        if (a < 2) {
            return 0;
        }

        return (a * (a - 1)) / 2;
    }
} Main

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int evenCount = sc.nextInt();
        int oddCount = sc.nextInt();

        int evenComb = comb(evenCount);
        int oddComb = comb(oddCount);

        System.out.println(evenComb + oddComb);
    }

    static int comb(int a) {
        if (a < 2) {
            return 0;
        }

        return (a * (a - 1)) / 2;
    }
}
