import java.util.Scanner;

class Main 
{

	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		
		int evenBalls = sc.nextInt();
		
		int oddBalls  = sc.nextInt();
		
		
		
		int evenAvailable = 0;
		
		for(int i=1; i<evenBalls; i++)
		{
			evenAvailable += i;
			
		}
		
		
		for(int i=1; i<oddBalls; i++)
		{
			evenAvailable += i;
			
		}
		
		System.out.println(evenAvailable);
		
		
		

	}

} import java.util.Scanner; Scanner java.util class Main 
{

	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		
		int evenBalls = sc.nextInt();
		
		int oddBalls  = sc.nextInt();
		
		
		
		int evenAvailable = 0;
		
		for(int i=1; i<evenBalls; i++)
		{
			evenAvailable += i;
			
		}
		
		
		for(int i=1; i<oddBalls; i++)
		{
			evenAvailable += i;
			
		}
		
		System.out.println(evenAvailable);
		
		
		

	}

} Main public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		
		int evenBalls = sc.nextInt();
		
		int oddBalls  = sc.nextInt();
		
		
		
		int evenAvailable = 0;
		
		for(int i=1; i<evenBalls; i++)
		{
			evenAvailable += i;
			
		}
		
		
		for(int i=1; i<oddBalls; i++)
		{
			evenAvailable += i;
			
		}
		
		System.out.println(evenAvailable);
		
		
		

	} main {
		Scanner sc = new Scanner(System.in);
		
		int evenBalls = sc.nextInt();
		
		int oddBalls  = sc.nextInt();
		
		
		
		int evenAvailable = 0;
		
		for(int i=1; i<evenBalls; i++)
		{
			evenAvailable += i;
			
		}
		
		
		for(int i=1; i<oddBalls; i++)
		{
			evenAvailable += i;
			
		}
		
		System.out.println(evenAvailable);
		
		
		

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int evenBalls = sc.nextInt(); evenBalls sc.nextInt() sc.nextInt sc int oddBalls  = sc.nextInt(); oddBalls sc.nextInt() sc.nextInt sc int evenAvailable = 0; evenAvailable 0 for(int i=1; i<evenBalls; i++)
		{
			evenAvailable += i;
			
		} int i=1; int i=1; i 1 i<evenBalls i evenBalls i++ i++ i {
			evenAvailable += i;
			
		} {
			evenAvailable += i;
			
		} evenAvailable += i evenAvailable i for(int i=1; i<oddBalls; i++)
		{
			evenAvailable += i;
			
		} int i=1; int i=1; i 1 i<oddBalls i oddBalls i++ i++ i {
			evenAvailable += i;
			
		} {
			evenAvailable += i;
			
		} evenAvailable += i evenAvailable i System.out.println(evenAvailable) System.out.println System.out System System.out evenAvailable String[] args args
import java.util.Scanner;

class Main 
{

	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		
		int evenBalls = sc.nextInt();
		
		int oddBalls  = sc.nextInt();
		
		
		
		int evenAvailable = 0;
		
		for(int i=1; i<evenBalls; i++)
		{
			evenAvailable += i;
			
		}
		
		
		for(int i=1; i<oddBalls; i++)
		{
			evenAvailable += i;
			
		}
		
		System.out.println(evenAvailable);
		
		
		

	}

}
