import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int count = 0;
        int[] array = new int[m + n];
        for (int a = 0; a < n; a++) {
            array[a] = 0;
        }
        for (int b = n; b < m + n; b++) {
            array[b] = 1;
        }

        for (int i = 0; i < m + n; i++) {
            for (int j = i; j < m + n; j++) {
                if (!(i == j) && (array[i] + array[j]) % 2 == 0) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }
} import java.util.Scanner; Scanner 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 count = 0;
        int[] array = new int[m + n];
        for (int a = 0; a < n; a++) {
            array[a] = 0;
        }
        for (int b = n; b < m + n; b++) {
            array[b] = 1;
        }

        for (int i = 0; i < m + n; i++) {
            for (int j = i; j < m + n; j++) {
                if (!(i == j) && (array[i] + array[j]) % 2 == 0) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int count = 0;
        int[] array = new int[m + n];
        for (int a = 0; a < n; a++) {
            array[a] = 0;
        }
        for (int b = n; b < m + n; b++) {
            array[b] = 1;
        }

        for (int i = 0; i < m + n; i++) {
            for (int j = i; j < m + n; j++) {
                if (!(i == j) && (array[i] + array[j]) % 2 == 0) {
                    count++;
                }
            }
        }
        System.out.println(count);
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int count = 0;
        int[] array = new int[m + n];
        for (int a = 0; a < n; a++) {
            array[a] = 0;
        }
        for (int b = n; b < m + n; b++) {
            array[b] = 1;
        }

        for (int i = 0; i < m + n; i++) {
            for (int j = i; j < m + n; j++) {
                if (!(i == j) && (array[i] + array[j]) % 2 == 0) {
                    count++;
                }
            }
        }
        System.out.println(count);
    } 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 count = 0; count 0 int[] array = new int[m + n]; array new int[m + n] m + n m n for (int a = 0; a < n; a++) {
            array[a] = 0;
        } int a = 0; int a = 0; a 0 a < n a n a++ a++ a {
            array[a] = 0;
        } {
            array[a] = 0;
        } array[a] = 0 array[a] array a 0 for (int b = n; b < m + n; b++) {
            array[b] = 1;
        } int b = n; int b = n; b n b < m + n b m + n m n b++ b++ b {
            array[b] = 1;
        } {
            array[b] = 1;
        } array[b] = 1 array[b] array b 1 for (int i = 0; i < m + n; i++) {
            for (int j = i; j < m + n; j++) {
                if (!(i == j) && (array[i] + array[j]) % 2 == 0) {
                    count++;
                }
            }
        } int i = 0; int i = 0; i 0 i < m + n i m + n m n i++ i++ i {
            for (int j = i; j < m + n; j++) {
                if (!(i == j) && (array[i] + array[j]) % 2 == 0) {
                    count++;
                }
            }
        } {
            for (int j = i; j < m + n; j++) {
                if (!(i == j) && (array[i] + array[j]) % 2 == 0) {
                    count++;
                }
            }
        } for (int j = i; j < m + n; j++) {
                if (!(i == j) && (array[i] + array[j]) % 2 == 0) {
                    count++;
                }
            } int j = i; int j = i; j i j < m + n j m + n m n j++ j++ j {
                if (!(i == j) && (array[i] + array[j]) % 2 == 0) {
                    count++;
                }
            } {
                if (!(i == j) && (array[i] + array[j]) % 2 == 0) {
                    count++;
                }
            } if (!(i == j) && (array[i] + array[j]) % 2 == 0) {
                    count++;
                } !(i == j) && (array[i] + array[j]) % 2 == 0 !(i == j) (i == j) i j (array[i] + array[j]) % 2 == 0 (array[i] + array[j]) % 2 (array[i] + array[j]) array[i] array i array[j] array j 2 0 {
                    count++;
                } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int count = 0;
        int[] array = new int[m + n];
        for (int a = 0; a < n; a++) {
            array[a] = 0;
        }
        for (int b = n; b < m + n; b++) {
            array[b] = 1;
        }

        for (int i = 0; i < m + n; i++) {
            for (int j = i; j < m + n; j++) {
                if (!(i == j) && (array[i] + array[j]) % 2 == 0) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int count = 0;
        int[] array = new int[m + n];
        for (int a = 0; a < n; a++) {
            array[a] = 0;
        }
        for (int b = n; b < m + n; b++) {
            array[b] = 1;
        }

        for (int i = 0; i < m + n; i++) {
            for (int j = i; j < m + n; j++) {
                if (!(i == j) && (array[i] + array[j]) % 2 == 0) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int count = 0;
        int[] array = new int[m + n];
        for (int a = 0; a < n; a++) {
            array[a] = 0;
        }
        for (int b = n; b < m + n; b++) {
            array[b] = 1;
        }

        for (int i = 0; i < m + n; i++) {
            for (int j = i; j < m + n; j++) {
                if (!(i == j) && (array[i] + array[j]) % 2 == 0) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}