import java.util.*;
import static java.lang.System.out;

public class Main {
    public static void main(String... args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] nArray = new int[n];
        int[] mArray = new int[m];

        for(int i=1;i<=n; i++) {
            nArray[i-1] = i*2;
        }
        for(int i=0;i<m; i++) {
            if(i==0) {
                mArray[i] = 1;
            } else {
                mArray[i] = n*2+1;
            }
        }
        int count=0;
        int[] array = new int[n+m];
        System.arraycopy(nArray, 0, array, 0, n);
        System.arraycopy(mArray, 0, array, n, m);

        for(int i=0;i<array.length ;i++) {
            for(int j=i+1; j<array.length; j++) {
                if((array[i]+ array[j])%2==0) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }
} import java.util.*; util.* java import static java.lang.System.out; import static java.lang.System.out; import static java.lang.System.out; public class Main {
    public static void main(String... args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] nArray = new int[n];
        int[] mArray = new int[m];

        for(int i=1;i<=n; i++) {
            nArray[i-1] = i*2;
        }
        for(int i=0;i<m; i++) {
            if(i==0) {
                mArray[i] = 1;
            } else {
                mArray[i] = n*2+1;
            }
        }
        int count=0;
        int[] array = new int[n+m];
        System.arraycopy(nArray, 0, array, 0, n);
        System.arraycopy(mArray, 0, array, n, m);

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

        for(int i=1;i<=n; i++) {
            nArray[i-1] = i*2;
        }
        for(int i=0;i<m; i++) {
            if(i==0) {
                mArray[i] = 1;
            } else {
                mArray[i] = n*2+1;
            }
        }
        int count=0;
        int[] array = new int[n+m];
        System.arraycopy(nArray, 0, array, 0, n);
        System.arraycopy(mArray, 0, array, n, m);

        for(int i=0;i<array.length ;i++) {
            for(int j=i+1; j<array.length; j++) {
                if((array[i]+ array[j])%2==0) {
                    count++;
                }
            }
        }
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] nArray = new int[n];
        int[] mArray = new int[m];

        for(int i=1;i<=n; i++) {
            nArray[i-1] = i*2;
        }
        for(int i=0;i<m; i++) {
            if(i==0) {
                mArray[i] = 1;
            } else {
                mArray[i] = n*2+1;
            }
        }
        int count=0;
        int[] array = new int[n+m];
        System.arraycopy(nArray, 0, array, 0, n);
        System.arraycopy(mArray, 0, array, n, m);

        for(int i=0;i<array.length ;i++) {
            for(int j=i+1; j<array.length; j++) {
                if((array[i]+ array[j])%2==0) {
                    count++;
                }
            }
        }
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int[] nArray = new int[n]; nArray new int[n] n int[] mArray = new int[m]; mArray new int[m] m for(int i=1;i<=n; i++) {
            nArray[i-1] = i*2;
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            nArray[i-1] = i*2;
        } {
            nArray[i-1] = i*2;
        } nArray[i-1] = i*2 nArray[i-1] nArray i-1 i 1 i*2 i 2 for(int i=0;i<m; i++) {
            if(i==0) {
                mArray[i] = 1;
            } else {
                mArray[i] = n*2+1;
            }
        } int i=0; int i=0; i 0 i<m i m i++ i++ i {
            if(i==0) {
                mArray[i] = 1;
            } else {
                mArray[i] = n*2+1;
            }
        } {
            if(i==0) {
                mArray[i] = 1;
            } else {
                mArray[i] = n*2+1;
            }
        } if(i==0) {
                mArray[i] = 1;
            } else {
                mArray[i] = n*2+1;
            } i==0 i 0 {
                mArray[i] = 1;
            } mArray[i] = 1 mArray[i] mArray i 1 {
                mArray[i] = n*2+1;
            } mArray[i] = n*2+1 mArray[i] mArray i n*2+1 n*2 n 2 1 int count=0; count 0 int[] array = new int[n+m]; array new int[n+m] n+m n m System.arraycopy(nArray, 0, array, 0, n) System.arraycopy System nArray 0 array 0 n System.arraycopy(mArray, 0, array, n, m) System.arraycopy System mArray 0 array n m for(int i=0;i<array.length ;i++) {
            for(int j=i+1; j<array.length; j++) {
                if((array[i]+ array[j])%2==0) {
                    count++;
                }
            }
        } int i=0; int i=0; i 0 i<array.length i array.length array array.length i++ i++ i {
            for(int j=i+1; j<array.length; j++) {
                if((array[i]+ array[j])%2==0) {
                    count++;
                }
            }
        } {
            for(int j=i+1; j<array.length; j++) {
                if((array[i]+ array[j])%2==0) {
                    count++;
                }
            }
        } for(int j=i+1; j<array.length; j++) {
                if((array[i]+ array[j])%2==0) {
                    count++;
                }
            } int j=i+1; int j=i+1; j i+1 i 1 j<array.length j array.length array array.length j++ j++ j {
                if((array[i]+ array[j])%2==0) {
                    count++;
                }
            } {
                if((array[i]+ array[j])%2==0) {
                    count++;
                }
            } if((array[i]+ array[j])%2==0) {
                    count++;
                } (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 sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] nArray = new int[n];
        int[] mArray = new int[m];

        for(int i=1;i<=n; i++) {
            nArray[i-1] = i*2;
        }
        for(int i=0;i<m; i++) {
            if(i==0) {
                mArray[i] = 1;
            } else {
                mArray[i] = n*2+1;
            }
        }
        int count=0;
        int[] array = new int[n+m];
        System.arraycopy(nArray, 0, array, 0, n);
        System.arraycopy(mArray, 0, array, n, m);

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

        for(int i=1;i<=n; i++) {
            nArray[i-1] = i*2;
        }
        for(int i=0;i<m; i++) {
            if(i==0) {
                mArray[i] = 1;
            } else {
                mArray[i] = n*2+1;
            }
        }
        int count=0;
        int[] array = new int[n+m];
        System.arraycopy(nArray, 0, array, 0, n);
        System.arraycopy(mArray, 0, array, n, m);

        for(int i=0;i<array.length ;i++) {
            for(int j=i+1; j<array.length; j++) {
                if((array[i]+ array[j])%2==0) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }
} Main
import java.util.*;
import static java.lang.System.out;

public class Main {
    public static void main(String... args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] nArray = new int[n];
        int[] mArray = new int[m];

        for(int i=1;i<=n; i++) {
            nArray[i-1] = i*2;
        }
        for(int i=0;i<m; i++) {
            if(i==0) {
                mArray[i] = 1;
            } else {
                mArray[i] = n*2+1;
            }
        }
        int count=0;
        int[] array = new int[n+m];
        System.arraycopy(nArray, 0, array, 0, n);
        System.arraycopy(mArray, 0, array, n, m);

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