#include<bits/stdc++.h> using namespace std; int main(){ int x,y,s=0; cin>>x>>y; if(x>=y && y!=0)cout<<(x-(x-y))*90+(x-y)*60; else cout<<(y-(y-x))*90+(y-x)*40; }