import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);

        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int nSum = 0;
        int mSum = 0;
        for (int i = 0; i < n; i++)
            nSum += i;
        for (int i = 0; i < m; i++)
            mSum += i;
        pw.println(nSum + mSum);
        
        pw.flush();
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);

        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int nSum = 0;
        int mSum = 0;
        for (int i = 0; i < n; i++)
            nSum += i;
        for (int i = 0; i < m; i++)
            mSum += i;
        pw.println(nSum + mSum);
        
        pw.flush();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);

        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int nSum = 0;
        int mSum = 0;
        for (int i = 0; i < n; i++)
            nSum += i;
        for (int i = 0; i < m; i++)
            mSum += i;
        pw.println(nSum + mSum);
        
        pw.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);

        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int nSum = 0;
        int mSum = 0;
        for (int i = 0; i < n; i++)
            nSum += i;
        for (int i = 0; i < m; i++)
            mSum += i;
        pw.println(nSum + mSum);
        
        pw.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter pw = new PrintWriter(System.out); pw new PrintWriter(System.out) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int m = Integer.parseInt(sc.next()); m Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int nSum = 0; nSum 0 int mSum = 0; mSum 0 for (int i = 0; i < n; i++)
            nSum += i; int i = 0; int i = 0; i 0 i < n i n i++ i++ i nSum += i; nSum += i nSum i for (int i = 0; i < m; i++)
            mSum += i; int i = 0; int i = 0; i 0 i < m i m i++ i++ i mSum += i; mSum += i mSum i pw.println(nSum + mSum) pw.println pw nSum + mSum nSum mSum pw.flush() pw.flush pw String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);

        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int nSum = 0;
        int mSum = 0;
        for (int i = 0; i < n; i++)
            nSum += i;
        for (int i = 0; i < m; i++)
            mSum += i;
        pw.println(nSum + mSum);
        
        pw.flush();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);

        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int nSum = 0;
        int mSum = 0;
        for (int i = 0; i < n; i++)
            nSum += i;
        for (int i = 0; i < m; i++)
            mSum += i;
        pw.println(nSum + mSum);
        
        pw.flush();
    }
} Main
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);

        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int nSum = 0;
        int mSum = 0;
        for (int i = 0; i < n; i++)
            nSum += i;
        for (int i = 0; i < m; i++)
            mSum += i;
        pw.println(nSum + mSum);
        
        pw.flush();
    }
}