import java.util.Scanner;

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

		int n = sc.nextInt() - 1;
		int m = sc.nextInt() - 1;

		int pattern = 0;

		for(int i = n; i > 0; i--)
		{
			pattern += i;
		}

		for(int i = m; i > 0; i--)
		{
			pattern += i;
		}

		System.out.println(pattern);

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

		int n = sc.nextInt() - 1;
		int m = sc.nextInt() - 1;

		int pattern = 0;

		for(int i = n; i > 0; i--)
		{
			pattern += i;
		}

		for(int i = m; i > 0; i--)
		{
			pattern += i;
		}

		System.out.println(pattern);

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

		int n = sc.nextInt() - 1;
		int m = sc.nextInt() - 1;

		int pattern = 0;

		for(int i = n; i > 0; i--)
		{
			pattern += i;
		}

		for(int i = m; i > 0; i--)
		{
			pattern += i;
		}

		System.out.println(pattern);

	} main {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt() - 1;
		int m = sc.nextInt() - 1;

		int pattern = 0;

		for(int i = n; i > 0; i--)
		{
			pattern += i;
		}

		for(int i = m; i > 0; i--)
		{
			pattern += i;
		}

		System.out.println(pattern);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt() - 1; n sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 int m = sc.nextInt() - 1; m sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 int pattern = 0; pattern 0 for(int i = n; i > 0; i--)
		{
			pattern += i;
		} int i = n; int i = n; i n i > 0 i 0 i-- i-- i {
			pattern += i;
		} {
			pattern += i;
		} pattern += i pattern i for(int i = m; i > 0; i--)
		{
			pattern += i;
		} int i = m; int i = m; i m i > 0 i 0 i-- i-- i {
			pattern += i;
		} {
			pattern += i;
		} pattern += i pattern i System.out.println(pattern) System.out.println System.out System System.out pattern String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt() - 1;
		int m = sc.nextInt() - 1;

		int pattern = 0;

		for(int i = n; i > 0; i--)
		{
			pattern += i;
		}

		for(int i = m; i > 0; i--)
		{
			pattern += i;
		}

		System.out.println(pattern);

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

		int n = sc.nextInt() - 1;
		int m = sc.nextInt() - 1;

		int pattern = 0;

		for(int i = n; i > 0; i--)
		{
			pattern += i;
		}

		for(int i = m; i > 0; i--)
		{
			pattern += i;
		}

		System.out.println(pattern);

	}
} Main
import java.util.Scanner;

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

		int n = sc.nextInt() - 1;
		int m = sc.nextInt() - 1;

		int pattern = 0;

		for(int i = n; i > 0; i--)
		{
			pattern += i;
		}

		for(int i = m; i > 0; i--)
		{
			pattern += i;
		}

		System.out.println(pattern);

	}
}
