import java.io.InputStream;
import java.util.*;


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

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

        int nCoeff = 0;
        int mCoeff = 0;

        if (n > 1) {
            nCoeff = binomialCoefficient(n, 2);
        }

        if (m > 1) {
            mCoeff = binomialCoefficient(m, 2);
        }

        System.out.println(nCoeff + mCoeff);
    }

    private static int binomialCoefficient(int n, int k) {
        int coefficient = 1;

        if (k > n - k) {
            k = n - k;
        }

        for (int i = 0; i < k; ++i) {
            coefficient *= (n - i);
            coefficient /= (i + 1);
        }

        return coefficient;
    }
} import java.io.InputStream; InputStream java.io import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

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

        int nCoeff = 0;
        int mCoeff = 0;

        if (n > 1) {
            nCoeff = binomialCoefficient(n, 2);
        }

        if (m > 1) {
            mCoeff = binomialCoefficient(m, 2);
        }

        System.out.println(nCoeff + mCoeff);
    }

    private static int binomialCoefficient(int n, int k) {
        int coefficient = 1;

        if (k > n - k) {
            k = n - k;
        }

        for (int i = 0; i < k; ++i) {
            coefficient *= (n - i);
            coefficient /= (i + 1);
        }

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

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

        int nCoeff = 0;
        int mCoeff = 0;

        if (n > 1) {
            nCoeff = binomialCoefficient(n, 2);
        }

        if (m > 1) {
            mCoeff = binomialCoefficient(m, 2);
        }

        System.out.println(nCoeff + mCoeff);
    } main {
        Scanner scanner = new Scanner(System.in);

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

        int nCoeff = 0;
        int mCoeff = 0;

        if (n > 1) {
            nCoeff = binomialCoefficient(n, 2);
        }

        if (m > 1) {
            mCoeff = binomialCoefficient(m, 2);
        }

        System.out.println(nCoeff + mCoeff);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int m = scanner.nextInt(); m scanner.nextInt() scanner.nextInt scanner int nCoeff = 0; nCoeff 0 int mCoeff = 0; mCoeff 0 if (n > 1) {
            nCoeff = binomialCoefficient(n, 2);
        } n > 1 n 1 {
            nCoeff = binomialCoefficient(n, 2);
        } nCoeff = binomialCoefficient(n, 2) nCoeff binomialCoefficient(n, 2) binomialCoefficient n 2 if (m > 1) {
            mCoeff = binomialCoefficient(m, 2);
        } m > 1 m 1 {
            mCoeff = binomialCoefficient(m, 2);
        } mCoeff = binomialCoefficient(m, 2) mCoeff binomialCoefficient(m, 2) binomialCoefficient m 2 System.out.println(nCoeff + mCoeff) System.out.println System.out System System.out nCoeff + mCoeff nCoeff mCoeff String[] args args private static int binomialCoefficient(int n, int k) {
        int coefficient = 1;

        if (k > n - k) {
            k = n - k;
        }

        for (int i = 0; i < k; ++i) {
            coefficient *= (n - i);
            coefficient /= (i + 1);
        }

        return coefficient;
    } binomialCoefficient {
        int coefficient = 1;

        if (k > n - k) {
            k = n - k;
        }

        for (int i = 0; i < k; ++i) {
            coefficient *= (n - i);
            coefficient /= (i + 1);
        }

        return coefficient;
    } int coefficient = 1; coefficient 1 if (k > n - k) {
            k = n - k;
        } k > n - k k n - k n k {
            k = n - k;
        } k = n - k k n - k n k for (int i = 0; i < k; ++i) {
            coefficient *= (n - i);
            coefficient /= (i + 1);
        } int i = 0; int i = 0; i 0 i < k i k ++i ++i i {
            coefficient *= (n - i);
            coefficient /= (i + 1);
        } {
            coefficient *= (n - i);
            coefficient /= (i + 1);
        } coefficient *= (n - i) coefficient (n - i) n i coefficient /= (i + 1) coefficient (i + 1) i 1 return coefficient; coefficient int n n int k k public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

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

        int nCoeff = 0;
        int mCoeff = 0;

        if (n > 1) {
            nCoeff = binomialCoefficient(n, 2);
        }

        if (m > 1) {
            mCoeff = binomialCoefficient(m, 2);
        }

        System.out.println(nCoeff + mCoeff);
    }

    private static int binomialCoefficient(int n, int k) {
        int coefficient = 1;

        if (k > n - k) {
            k = n - k;
        }

        for (int i = 0; i < k; ++i) {
            coefficient *= (n - i);
            coefficient /= (i + 1);
        }

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

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

        int nCoeff = 0;
        int mCoeff = 0;

        if (n > 1) {
            nCoeff = binomialCoefficient(n, 2);
        }

        if (m > 1) {
            mCoeff = binomialCoefficient(m, 2);
        }

        System.out.println(nCoeff + mCoeff);
    }

    private static int binomialCoefficient(int n, int k) {
        int coefficient = 1;

        if (k > n - k) {
            k = n - k;
        }

        for (int i = 0; i < k; ++i) {
            coefficient *= (n - i);
            coefficient /= (i + 1);
        }

        return coefficient;
    }
} Main
import java.io.InputStream;
import java.util.*;


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

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

        int nCoeff = 0;
        int mCoeff = 0;

        if (n > 1) {
            nCoeff = binomialCoefficient(n, 2);
        }

        if (m > 1) {
            mCoeff = binomialCoefficient(m, 2);
        }

        System.out.println(nCoeff + mCoeff);
    }

    private static int binomialCoefficient(int n, int k) {
        int coefficient = 1;

        if (k > n - k) {
            k = n - k;
        }

        for (int i = 0; i < k; ++i) {
            coefficient *= (n - i);
            coefficient /= (i + 1);
        }

        return coefficient;
    }
}