#include<bits/stdc++.h> using namespace std; int main() { int cnt,a,b,c; cin>>a>>b>>c; cnt=a*3600+b*60+c; cout<<cnt; return 0; }