#include<cstdio>
#include<vector>
using namespace std;
int main(){
	int a, n;
	while (scanf("%d %d", &a, &n) != EOF){
		vector<int> num;
		for (int i = 0; i < n; i++){
			num.push_back(a*(n - i));
		}
		num.push_back(0);
		int m = 0;
		for (int i = 0; i < num.size(); i++){
			num[i] += m;
			m = num[i] / 10;
			num[i] = num[i] % 10;
		}
		if (num[num.size()-1] != 0){
			for (int i = num.size() - 1; i >= 0; i--){
				printf("%d", num[i]);
			}
		}
		else{
			for (int i = num.size() - 2; i >= 0; i--){
				printf("%d", num[i]);
			}
		}
		printf("\n");
	}
}