#include <iostream>
#include <string>
using namespace std;
int calcTotalFees(string &E, string& L)
{
int totalFee=0;
int startH = (E.at(0)-'0')*10 + (E.at(1)-'0');
int endH = (L.at(0)-'0')*10 + (L.at(1)-'0');
int startM = (E.at(3)-'0')*10 + (E.at(4)-'0');
int endM = (L.at(3)-'0')*10 + (L.at(4)-'0');
if( startH == endH )
{
totalFee += 2 + 3;
}else if( startH + 1 == endH)
{
if( startM >= endM)
{
totalFee += 2 + 3;
}else
{
totalFee += 2+3 + 4*1;
}
}else
{
if(startM >= endM)
{
totalFee += 2 + 3 + 4 *( endH - startH -1);
}else
{
totalFee += 2 + 3 + 4 *( endH - startH);
}
}
return totalFee;
}
int main(int argc, char ** argv)
{
while(true)
{
string E, L;
cout << "StartTime:\n";
cin >> E;
cout << "EndTime:\n";
cin >> L;
cout << "Your ParkingLot Fee: " << calcTotalFees(E,L) << endl;
}
return 0;
}