Okabe needs bananas for one of his experiments for some strange reason. So he decides to go to the forest and cut banana trees.

Consider the point (x, y) in the 2D plane such that x and y are integers and 0 ≤ x, y. There is a tree in such a point, and it has x + y bananas. There are no trees nor bananas in other points. Now, Okabe draws a line with equation <image>. Okabe can select a single rectangle with axis aligned sides with all points on or under the line and cut all the trees in all points that are inside or on the border of this rectangle and take their bananas. Okabe's rectangle can be degenerate; that is, it can be a line segment or even a point.

Help Okabe and find the maximum number of bananas he can get if he chooses the rectangle wisely.

Okabe is sure that the answer does not exceed 1018. You can trust him.

Input

The first line of input contains two space-separated integers m and b (1 ≤ m ≤ 1000, 1 ≤ b ≤ 10000).

Output

Print the maximum number of bananas Okabe can get from the trees he cuts.

Examples

Input

1 5


Output

30


Input

2 3


Output

25

Note

<image>

The graph above corresponds to sample test 1. The optimal rectangle is shown in red and has 30 bananas.
import java.io.*;
import java.util.*;
import java.math.*;
public class Main {
	static BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
public static void main(String args[]) throws NumberFormatException, IOException {
	//next<datatype>() for input of a type
	//next<datatyoe>array() for array input of a type
	//next<datatyoe>array() for array input of a type
	int mb[] = nextIntarray();
	int m =mb[0],b=mb[1];
//	int b = nextInt();
	long x = m*b;
	long lsum=0,max=0;
	for(int i=0;i<=x;i++){
		int y = (int)Math.floor((-(double)i/(double)m+(double)b));
		lsum=(long)(((long)y*(y+1))/2)*(long)(i+1)+ (((long)i*(i+1))/2)*(long)(y+1);
	
//		System.out.println(i+" "+y);
		max=Math.max(lsum,max);
	}
	System.out.println(max);
//############################################################################################################
    //Collections.reverse(n);
    
//	HashMap<Integer, Integer> hmap = new HashMap<Integer, Integer>();
//	for(Map.Entry pair: hmap.entrySet()){
//		
//	}

////		it = hmap.entrySet().iterator();	
////		while (it.hasNext()) {
////	        Map.Entry pair = (Map.Entry)it.next();
//////		        System.out.println(pair.getKey() + " = " + pair.getValue());
////	        ArrayList<Object> x=(ArrayList<Object>) pair.getValue();
////	        for(int i=0;i<x.size();i++){
//////	        	System.out.println(arr[(int)x.get(i)]);
////	        	if(arr[(int)x.get(i)]!=1){
//////	        		System.out.println(x.get(i)+"xxx");
////	        		int idx = (int)pair.getKey();
////	        		ans[idx]=(int)x.get(i);
////		        	arr[(int)x.get(i)]=1;
////		        	break;
////	        	}
////	        }
//////	        it.remove(); // avoids a ConcurrentModificationException
////	    }

	
	}
	

class Mycompare implements Comparator<Integer>{
	public int compare(Integer x, Integer y){
		return -1;
	}
}


public static ArrayList<Integer> findPerm(final String A, int B) {
    int cntI=0,cntD=0;
    int ni = B,nd=1;
    ArrayList<Integer> ans = new ArrayList<Integer>();
    for(int i=0;i<B-1;i++){
        if(A.charAt(i)=='D'){
            ans.add(ni);
            System.out.println(ni);
            ni=ni-1;
        }
        else{
            ans.add(nd);
            System.out.println(nd);
            nd+=1;
        }
    }
    ans.add(nd);
    
     for(int i=0;i<ans.size();i++){
         System.out.println("a"+ans.get(i));
     }
    return ans;
}



private static double[] nextDoublearray() throws IOException {
	String s[]=bf.readLine().split(" ");
	double arr[]=new double[s.length];
	for(int i=0;i<s.length;i++){
		arr[i]=Double.parseDouble(s[i]);
	}
	return arr;
}

private static double nextDouble() throws NumberFormatException, IOException {
	return Double.parseDouble(bf.readLine());
}

private static long GCD(long a, long b) {
	   if (b==0) return a;
	   return GCD(b,a%b);
}

private static long[] nextLongarray() throws IOException {
	String s[]=bf.readLine().split(" ");
	long arr[]=new long[s.length];
	for(int i=0;i<s.length;i++){
		arr[i]=Long.parseLong(s[i]);
	}
	return arr;
	}

private static long nextLong() throws NumberFormatException, IOException {
	return Long.parseLong(bf.readLine());
	}

private static int[] nextIntarray() throws IOException {
	String s[]=bf.readLine().split(" ");
	int arr[]=new int[s.length];
	for(int i=0;i<s.length;i++){
		arr[i]=Integer.parseInt(s[i]);
	}
	return arr;
}

private static int nextInt() throws NumberFormatException, IOException {
	return Integer.parseInt(bf.readLine());
}
private static boolean isPalindrome(String s) {

	  int n = s.length();
	  for (int i=0;i<(n / 2) + 1;++i) {
	     if (s.charAt(i) != s.charAt(n - i - 1)) {
	         return false;
	     }
	  }

	  return true;
	}
private static int factorial(int num)
{
    if (num == 0 || num == 1)
    {
        return 1;
    }
    else
    {
        return(num * factorial(num - 1));
    }
}
private static long power(long b,long e){
if (e == 0) return 1;
	    if (e%2==0) return power(b*b, e/2);
	    /* e is odd */ return b * power(b, e-1);
}
private static long lcm(long a, long b)
{
    return a * (b / GCD(a, b));
}

private static boolean isPrimeNumber(long number){
     
        for(long i=2; i<=number/2; i++){
            if(number % i == 0){
                return false;
            }
        }
        return true;
    }



/*COMBINATION CODE
	void combinationUtil(int arr[], int n, int r, int index, int data[], int i)
{
    // Current cobination is ready, print it
    if (index == r)
    {
        for (int j=0; j<r; j++)
            printf("%d ",data[j]);
        printf("\n");
        return;
    }
 
    // When no more elements are there to put in data[]
    if (i >= n)
        return;
 
    // current is included, put next at next location
    data[index] = arr[i];
    combinationUtil(arr, n, r, index+1, data, i+1);
 
    // current is excluded, replace it with next (Note that
    // i+1 is passed, but index is not changed)
    combinationUtil(arr, n, r, index, data, i+1);

	}
		 */


//PERMUTATION CODE	
/*
		  
		 void permute(char *a, int l, int r)
	{
   int i;
   if (l == r)
     printf("%s\n", a);
   else
   {
       for (i = l; i <= r; i++)
       {
          swap((a+l), (a+i));	
          permute(a, l+1, r);
          swap((a+l), (a+i)); //backtrack
       }
   }
	}*/


}