#include<iostream>
using namespace std;
int main() {
int x,y,z;
cin>>x>>y>>z;
cout<<x*120+y*60+z*72;
return 0;
}