Under construction

Still being built. Things may change

Correct

Time limit3sMemory limit1024 MB

Summary
Given a submission time HH:MM AM and a contest that started at 9:00 AM, print the number of minutes elapsed since the start.
Level

Easy1 of 10

Topics
Implementation, Math
Solved
No attempts yet

Statement

Your best friend, Charlie, participated in the Taiwan Online Programming Contest (TOPC), a preliminary contest of the International Collegiate Programming Contest (ICPC).

Teams are ranked by the number of problems solved. Teams with the same number of solved problems are ranked by the smaller total time. The total time is the sum of the time consumed for each solved problem. The time consumed for a solved problem is the time elapsed from the start of the contest to the submission of the correct answer, plus 20 penalty minutes for every rejected submission for that problem. A problem that is not solved consumes no time.

Charlie's team solved only one problem. The correct answer was submitted at HH:MM AM. The team made no rejected submissions. Write a program that computes the time consumed for this problem. TOPC started at 9:00 AM.

Input

The input contains two space-separated integers HH and MM.

Output

Output the time consumed for the only problem solved by Charlie's team.

Constraints

  • 9 ≤ HH ≤ 11.
  • 0 ≤ MM ≤ 59.

Examples2

  1. Example 1

    Input
    9 0
    
    Expected output
    0
    
  2. Example 2

    Input
    11 59
    
    Expected output
    179