import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {

	public static void main(String[] args) throws IOException {
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			String W = in.readLine();

			int N = Integer.parseInt(W.split(" ")[0]);
			int M = Integer.parseInt(W.split(" ")[1]);

         int allPatternsNM = (N + M)*(N + M -1)/2;
         int eachPatternsNM = N*M;
         int ans= allPatternsNM - eachPatternsNM;
         System.out.println(ans);
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws IOException {
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			String W = in.readLine();

			int N = Integer.parseInt(W.split(" ")[0]);
			int M = Integer.parseInt(W.split(" ")[1]);

         int allPatternsNM = (N + M)*(N + M -1)/2;
         int eachPatternsNM = N*M;
         int ans= allPatternsNM - eachPatternsNM;
         System.out.println(ans);
	}

} Main public static void main(String[] args) throws IOException {
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			String W = in.readLine();

			int N = Integer.parseInt(W.split(" ")[0]);
			int M = Integer.parseInt(W.split(" ")[1]);

         int allPatternsNM = (N + M)*(N + M -1)/2;
         int eachPatternsNM = N*M;
         int ans= allPatternsNM - eachPatternsNM;
         System.out.println(ans);
	} main {
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			String W = in.readLine();

			int N = Integer.parseInt(W.split(" ")[0]);
			int M = Integer.parseInt(W.split(" ")[1]);

         int allPatternsNM = (N + M)*(N + M -1)/2;
         int eachPatternsNM = N*M;
         int ans= allPatternsNM - eachPatternsNM;
         System.out.println(ans);
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String W = in.readLine(); W in.readLine() in.readLine in int N = Integer.parseInt(W.split(" ")[0]); N Integer.parseInt(W.split(" ")[0]) Integer.parseInt Integer W.split(" ")[0] W.split(" ") W.split W " " 0 int M = Integer.parseInt(W.split(" ")[1]); M Integer.parseInt(W.split(" ")[1]) Integer.parseInt Integer W.split(" ")[1] W.split(" ") W.split W " " 1 int allPatternsNM = (N + M)*(N + M -1)/2; allPatternsNM (N + M)*(N + M -1)/2 (N + M)*(N + M -1) (N + M) N M (N + M -1) N + M N M 1 2 int eachPatternsNM = N*M; eachPatternsNM N*M N M int ans= allPatternsNM - eachPatternsNM; ans allPatternsNM - eachPatternsNM allPatternsNM eachPatternsNM System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) throws IOException {
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			String W = in.readLine();

			int N = Integer.parseInt(W.split(" ")[0]);
			int M = Integer.parseInt(W.split(" ")[1]);

         int allPatternsNM = (N + M)*(N + M -1)/2;
         int eachPatternsNM = N*M;
         int ans= allPatternsNM - eachPatternsNM;
         System.out.println(ans);
	}

} public class Main {

	public static void main(String[] args) throws IOException {
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			String W = in.readLine();

			int N = Integer.parseInt(W.split(" ")[0]);
			int M = Integer.parseInt(W.split(" ")[1]);

         int allPatternsNM = (N + M)*(N + M -1)/2;
         int eachPatternsNM = N*M;
         int ans= allPatternsNM - eachPatternsNM;
         System.out.println(ans);
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {

	public static void main(String[] args) throws IOException {
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			String W = in.readLine();

			int N = Integer.parseInt(W.split(" ")[0]);
			int M = Integer.parseInt(W.split(" ")[1]);

         int allPatternsNM = (N + M)*(N + M -1)/2;
         int eachPatternsNM = N*M;
         int ans= allPatternsNM - eachPatternsNM;
         System.out.println(ans);
	}

}
