#include <iostream> using namespace std; int main(){ int a; cin >> a; int b; while(cin >> b, b <= 0) ; cout << b * (a + a + b - 1) / 2 << endl; return 0; }