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

public class Main
{
    private static List<Integer> numbers;

    public static void main(String[] args)
    {
	Scanner scanner = new Scanner(System.in);
	int nEvenBalls = scanner.nextInt();
	int mOddBalls = scanner.nextInt();
	scanner.close();

	numbers = new ArrayList<>();
	generateNumbers(nEvenBalls, true);
	generateNumbers(mOddBalls, false);

	int numberOfEvenPairs = 0;

	for (int i = 0; i < numbers.size(); i++)
	{
	    for (int j = i + 1; j < numbers.size(); j++)
	    {
		int sum = numbers.get(i) + numbers.get(j);

		if ((sum % 2) == 0)
		{
		    // even
		    numberOfEvenPairs++;
		}
	    }
	}

	System.out.println(numberOfEvenPairs);

    }

    private static void generateNumbers(int howMany, boolean even)
    {
	for (int i = 1; i <= howMany; i++)
	{
	    numbers.add(even ? 2 : 1);
	}
    }

} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main
{
    private static List<Integer> numbers;

    public static void main(String[] args)
    {
	Scanner scanner = new Scanner(System.in);
	int nEvenBalls = scanner.nextInt();
	int mOddBalls = scanner.nextInt();
	scanner.close();

	numbers = new ArrayList<>();
	generateNumbers(nEvenBalls, true);
	generateNumbers(mOddBalls, false);

	int numberOfEvenPairs = 0;

	for (int i = 0; i < numbers.size(); i++)
	{
	    for (int j = i + 1; j < numbers.size(); j++)
	    {
		int sum = numbers.get(i) + numbers.get(j);

		if ((sum % 2) == 0)
		{
		    // even
		    numberOfEvenPairs++;
		}
	    }
	}

	System.out.println(numberOfEvenPairs);

    }

    private static void generateNumbers(int howMany, boolean even)
    {
	for (int i = 1; i <= howMany; i++)
	{
	    numbers.add(even ? 2 : 1);
	}
    }

} Main private static List<Integer> numbers; numbers public static void main(String[] args)
    {
	Scanner scanner = new Scanner(System.in);
	int nEvenBalls = scanner.nextInt();
	int mOddBalls = scanner.nextInt();
	scanner.close();

	numbers = new ArrayList<>();
	generateNumbers(nEvenBalls, true);
	generateNumbers(mOddBalls, false);

	int numberOfEvenPairs = 0;

	for (int i = 0; i < numbers.size(); i++)
	{
	    for (int j = i + 1; j < numbers.size(); j++)
	    {
		int sum = numbers.get(i) + numbers.get(j);

		if ((sum % 2) == 0)
		{
		    // even
		    numberOfEvenPairs++;
		}
	    }
	}

	System.out.println(numberOfEvenPairs);

    } main {
	Scanner scanner = new Scanner(System.in);
	int nEvenBalls = scanner.nextInt();
	int mOddBalls = scanner.nextInt();
	scanner.close();

	numbers = new ArrayList<>();
	generateNumbers(nEvenBalls, true);
	generateNumbers(mOddBalls, false);

	int numberOfEvenPairs = 0;

	for (int i = 0; i < numbers.size(); i++)
	{
	    for (int j = i + 1; j < numbers.size(); j++)
	    {
		int sum = numbers.get(i) + numbers.get(j);

		if ((sum % 2) == 0)
		{
		    // even
		    numberOfEvenPairs++;
		}
	    }
	}

	System.out.println(numberOfEvenPairs);

    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int nEvenBalls = scanner.nextInt(); nEvenBalls scanner.nextInt() scanner.nextInt scanner int mOddBalls = scanner.nextInt(); mOddBalls scanner.nextInt() scanner.nextInt scanner scanner.close() scanner.close scanner numbers = new ArrayList<>() numbers new ArrayList<>() generateNumbers(nEvenBalls, true) generateNumbers nEvenBalls true generateNumbers(mOddBalls, false) generateNumbers mOddBalls false int numberOfEvenPairs = 0; numberOfEvenPairs 0 for (int i = 0; i < numbers.size(); i++)
	{
	    for (int j = i + 1; j < numbers.size(); j++)
	    {
		int sum = numbers.get(i) + numbers.get(j);

		if ((sum % 2) == 0)
		{
		    // even
		    numberOfEvenPairs++;
		}
	    }
	} int i = 0; int i = 0; i 0 i < numbers.size() i numbers.size() numbers.size numbers i++ i++ i {
	    for (int j = i + 1; j < numbers.size(); j++)
	    {
		int sum = numbers.get(i) + numbers.get(j);

		if ((sum % 2) == 0)
		{
		    // even
		    numberOfEvenPairs++;
		}
	    }
	} {
	    for (int j = i + 1; j < numbers.size(); j++)
	    {
		int sum = numbers.get(i) + numbers.get(j);

		if ((sum % 2) == 0)
		{
		    // even
		    numberOfEvenPairs++;
		}
	    }
	} for (int j = i + 1; j < numbers.size(); j++)
	    {
		int sum = numbers.get(i) + numbers.get(j);

		if ((sum % 2) == 0)
		{
		    // even
		    numberOfEvenPairs++;
		}
	    } int j = i + 1; int j = i + 1; j i + 1 i 1 j < numbers.size() j numbers.size() numbers.size numbers j++ j++ j {
		int sum = numbers.get(i) + numbers.get(j);

		if ((sum % 2) == 0)
		{
		    // even
		    numberOfEvenPairs++;
		}
	    } {
		int sum = numbers.get(i) + numbers.get(j);

		if ((sum % 2) == 0)
		{
		    // even
		    numberOfEvenPairs++;
		}
	    } int sum = numbers.get(i) + numbers.get(j); sum numbers.get(i) + numbers.get(j) numbers.get(i) numbers.get numbers i numbers.get(j) numbers.get numbers j if ((sum % 2) == 0)
		{
		    // even
		    numberOfEvenPairs++;
		} (sum % 2) == 0 (sum % 2) sum 2 0 {
		    // even
		    numberOfEvenPairs++;
		} numberOfEvenPairs++ numberOfEvenPairs System.out.println(numberOfEvenPairs) System.out.println System.out System System.out numberOfEvenPairs String[] args args private static void generateNumbers(int howMany, boolean even)
    {
	for (int i = 1; i <= howMany; i++)
	{
	    numbers.add(even ? 2 : 1);
	}
    } generateNumbers {
	for (int i = 1; i <= howMany; i++)
	{
	    numbers.add(even ? 2 : 1);
	}
    } for (int i = 1; i <= howMany; i++)
	{
	    numbers.add(even ? 2 : 1);
	} int i = 1; int i = 1; i 1 i <= howMany i howMany i++ i++ i {
	    numbers.add(even ? 2 : 1);
	} {
	    numbers.add(even ? 2 : 1);
	} numbers.add(even ? 2 : 1) numbers.add numbers even ? 2 : 1 even 2 1 int howMany howMany boolean even even public class Main
{
    private static List<Integer> numbers;

    public static void main(String[] args)
    {
	Scanner scanner = new Scanner(System.in);
	int nEvenBalls = scanner.nextInt();
	int mOddBalls = scanner.nextInt();
	scanner.close();

	numbers = new ArrayList<>();
	generateNumbers(nEvenBalls, true);
	generateNumbers(mOddBalls, false);

	int numberOfEvenPairs = 0;

	for (int i = 0; i < numbers.size(); i++)
	{
	    for (int j = i + 1; j < numbers.size(); j++)
	    {
		int sum = numbers.get(i) + numbers.get(j);

		if ((sum % 2) == 0)
		{
		    // even
		    numberOfEvenPairs++;
		}
	    }
	}

	System.out.println(numberOfEvenPairs);

    }

    private static void generateNumbers(int howMany, boolean even)
    {
	for (int i = 1; i <= howMany; i++)
	{
	    numbers.add(even ? 2 : 1);
	}
    }

} public class Main
{
    private static List<Integer> numbers;

    public static void main(String[] args)
    {
	Scanner scanner = new Scanner(System.in);
	int nEvenBalls = scanner.nextInt();
	int mOddBalls = scanner.nextInt();
	scanner.close();

	numbers = new ArrayList<>();
	generateNumbers(nEvenBalls, true);
	generateNumbers(mOddBalls, false);

	int numberOfEvenPairs = 0;

	for (int i = 0; i < numbers.size(); i++)
	{
	    for (int j = i + 1; j < numbers.size(); j++)
	    {
		int sum = numbers.get(i) + numbers.get(j);

		if ((sum % 2) == 0)
		{
		    // even
		    numberOfEvenPairs++;
		}
	    }
	}

	System.out.println(numberOfEvenPairs);

    }

    private static void generateNumbers(int howMany, boolean even)
    {
	for (int i = 1; i <= howMany; i++)
	{
	    numbers.add(even ? 2 : 1);
	}
    }

} Main

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

public class Main
{
    private static List<Integer> numbers;

    public static void main(String[] args)
    {
	Scanner scanner = new Scanner(System.in);
	int nEvenBalls = scanner.nextInt();
	int mOddBalls = scanner.nextInt();
	scanner.close();

	numbers = new ArrayList<>();
	generateNumbers(nEvenBalls, true);
	generateNumbers(mOddBalls, false);

	int numberOfEvenPairs = 0;

	for (int i = 0; i < numbers.size(); i++)
	{
	    for (int j = i + 1; j < numbers.size(); j++)
	    {
		int sum = numbers.get(i) + numbers.get(j);

		if ((sum % 2) == 0)
		{
		    // even
		    numberOfEvenPairs++;
		}
	    }
	}

	System.out.println(numberOfEvenPairs);

    }

    private static void generateNumbers(int howMany, boolean even)
    {
	for (int i = 1; i <= howMany; i++)
	{
	    numbers.add(even ? 2 : 1);
	}
    }

}
