import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String l1 = scan.nextLine();
		scan.close();

		int N = Integer.valueOf(l1.split(" ")[0]);
		int M = Integer.valueOf(l1.split(" ")[1]);

		ArrayList<Integer> NMList = new ArrayList<Integer>();

		for (int i = 0; i < N; i++) {
			NMList.add(2);
		}

		for (int i = 0; i < M; i++) {
			NMList.add(1);
		}

		int result = 0;

		for (int i = 0; i < NMList.size(); i++) {
			for (int j = i + 1; j < NMList.size(); j++) {
				int a = NMList.get(i);
				int b = NMList.get(j);

				if (((a + b) % 2) == 0) {
					result++;
				}
			}
		}

		System.out.println(result);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String l1 = scan.nextLine();
		scan.close();

		int N = Integer.valueOf(l1.split(" ")[0]);
		int M = Integer.valueOf(l1.split(" ")[1]);

		ArrayList<Integer> NMList = new ArrayList<Integer>();

		for (int i = 0; i < N; i++) {
			NMList.add(2);
		}

		for (int i = 0; i < M; i++) {
			NMList.add(1);
		}

		int result = 0;

		for (int i = 0; i < NMList.size(); i++) {
			for (int j = i + 1; j < NMList.size(); j++) {
				int a = NMList.get(i);
				int b = NMList.get(j);

				if (((a + b) % 2) == 0) {
					result++;
				}
			}
		}

		System.out.println(result);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String l1 = scan.nextLine();
		scan.close();

		int N = Integer.valueOf(l1.split(" ")[0]);
		int M = Integer.valueOf(l1.split(" ")[1]);

		ArrayList<Integer> NMList = new ArrayList<Integer>();

		for (int i = 0; i < N; i++) {
			NMList.add(2);
		}

		for (int i = 0; i < M; i++) {
			NMList.add(1);
		}

		int result = 0;

		for (int i = 0; i < NMList.size(); i++) {
			for (int j = i + 1; j < NMList.size(); j++) {
				int a = NMList.get(i);
				int b = NMList.get(j);

				if (((a + b) % 2) == 0) {
					result++;
				}
			}
		}

		System.out.println(result);
	} main {
		Scanner scan = new Scanner(System.in);
		String l1 = scan.nextLine();
		scan.close();

		int N = Integer.valueOf(l1.split(" ")[0]);
		int M = Integer.valueOf(l1.split(" ")[1]);

		ArrayList<Integer> NMList = new ArrayList<Integer>();

		for (int i = 0; i < N; i++) {
			NMList.add(2);
		}

		for (int i = 0; i < M; i++) {
			NMList.add(1);
		}

		int result = 0;

		for (int i = 0; i < NMList.size(); i++) {
			for (int j = i + 1; j < NMList.size(); j++) {
				int a = NMList.get(i);
				int b = NMList.get(j);

				if (((a + b) % 2) == 0) {
					result++;
				}
			}
		}

		System.out.println(result);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String l1 = scan.nextLine(); l1 scan.nextLine() scan.nextLine scan scan.close() scan.close scan int N = Integer.valueOf(l1.split(" ")[0]); N Integer.valueOf(l1.split(" ")[0]) Integer.valueOf Integer l1.split(" ")[0] l1.split(" ") l1.split l1 " " 0 int M = Integer.valueOf(l1.split(" ")[1]); M Integer.valueOf(l1.split(" ")[1]) Integer.valueOf Integer l1.split(" ")[1] l1.split(" ") l1.split l1 " " 1 ArrayList<Integer> NMList = new ArrayList<Integer>(); NMList new ArrayList<Integer>() for (int i = 0; i < N; i++) {
			NMList.add(2);
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			NMList.add(2);
		} {
			NMList.add(2);
		} NMList.add(2) NMList.add NMList 2 for (int i = 0; i < M; i++) {
			NMList.add(1);
		} int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
			NMList.add(1);
		} {
			NMList.add(1);
		} NMList.add(1) NMList.add NMList 1 int result = 0; result 0 for (int i = 0; i < NMList.size(); i++) {
			for (int j = i + 1; j < NMList.size(); j++) {
				int a = NMList.get(i);
				int b = NMList.get(j);

				if (((a + b) % 2) == 0) {
					result++;
				}
			}
		} int i = 0; int i = 0; i 0 i < NMList.size() i NMList.size() NMList.size NMList i++ i++ i {
			for (int j = i + 1; j < NMList.size(); j++) {
				int a = NMList.get(i);
				int b = NMList.get(j);

				if (((a + b) % 2) == 0) {
					result++;
				}
			}
		} {
			for (int j = i + 1; j < NMList.size(); j++) {
				int a = NMList.get(i);
				int b = NMList.get(j);

				if (((a + b) % 2) == 0) {
					result++;
				}
			}
		} for (int j = i + 1; j < NMList.size(); j++) {
				int a = NMList.get(i);
				int b = NMList.get(j);

				if (((a + b) % 2) == 0) {
					result++;
				}
			} int j = i + 1; int j = i + 1; j i + 1 i 1 j < NMList.size() j NMList.size() NMList.size NMList j++ j++ j {
				int a = NMList.get(i);
				int b = NMList.get(j);

				if (((a + b) % 2) == 0) {
					result++;
				}
			} {
				int a = NMList.get(i);
				int b = NMList.get(j);

				if (((a + b) % 2) == 0) {
					result++;
				}
			} int a = NMList.get(i); a NMList.get(i) NMList.get NMList i int b = NMList.get(j); b NMList.get(j) NMList.get NMList j if (((a + b) % 2) == 0) {
					result++;
				} ((a + b) % 2) == 0 ((a + b) % 2) (a + b) a b 2 0 {
					result++;
				} result++ result System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String l1 = scan.nextLine();
		scan.close();

		int N = Integer.valueOf(l1.split(" ")[0]);
		int M = Integer.valueOf(l1.split(" ")[1]);

		ArrayList<Integer> NMList = new ArrayList<Integer>();

		for (int i = 0; i < N; i++) {
			NMList.add(2);
		}

		for (int i = 0; i < M; i++) {
			NMList.add(1);
		}

		int result = 0;

		for (int i = 0; i < NMList.size(); i++) {
			for (int j = i + 1; j < NMList.size(); j++) {
				int a = NMList.get(i);
				int b = NMList.get(j);

				if (((a + b) % 2) == 0) {
					result++;
				}
			}
		}

		System.out.println(result);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String l1 = scan.nextLine();
		scan.close();

		int N = Integer.valueOf(l1.split(" ")[0]);
		int M = Integer.valueOf(l1.split(" ")[1]);

		ArrayList<Integer> NMList = new ArrayList<Integer>();

		for (int i = 0; i < N; i++) {
			NMList.add(2);
		}

		for (int i = 0; i < M; i++) {
			NMList.add(1);
		}

		int result = 0;

		for (int i = 0; i < NMList.size(); i++) {
			for (int j = i + 1; j < NMList.size(); j++) {
				int a = NMList.get(i);
				int b = NMList.get(j);

				if (((a + b) % 2) == 0) {
					result++;
				}
			}
		}

		System.out.println(result);
	}
} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String l1 = scan.nextLine();
		scan.close();

		int N = Integer.valueOf(l1.split(" ")[0]);
		int M = Integer.valueOf(l1.split(" ")[1]);

		ArrayList<Integer> NMList = new ArrayList<Integer>();

		for (int i = 0; i < N; i++) {
			NMList.add(2);
		}

		for (int i = 0; i < M; i++) {
			NMList.add(1);
		}

		int result = 0;

		for (int i = 0; i < NMList.size(); i++) {
			for (int j = i + 1; j < NMList.size(); j++) {
				int a = NMList.get(i);
				int b = NMList.get(j);

				if (((a + b) % 2) == 0) {
					result++;
				}
			}
		}

		System.out.println(result);
	}
}