#include <bits/stdc++.h>
using namespace std;
int main() {
int h, m, s;
cin >> h >> m >> s;
cout << h * 3600 + m * 60 + s << endl;
return 0;
}