#include <iostream>
using namespace std;
int main(){ int n,m,mk,nk; while(cin>>n>>m){ mk=(n*(m*3))+(n*2)+m; cout<<mk<<endl; }}