把题目理清楚 然后死算
注意 要用longlong即可
//P1615 西游记公司
//2016.11.26
#include <iostream>
#include <cstdio>
using namespace std;
int a1, b1, c1, a2, b2, c2;
long long n, x, y; //注意要用longlong
int main(){
scanf("%d:%d:%d", &a1, &b1, &c1);
scanf("%d:%d:%d", &a2, &b2, &c2);
scanf("%d", &n);
x = 3600 * a1 + 60 * b1 + c1;
y = 3600 * a2 + 60 * b2 + c2;
n = n * (y - x);
cout << n;
return 0;
}