#B3887. Hong Kong Observatory Warning Signal

    ID: 11544 Type: Default 1000ms 256MiB

Hong Kong Observatory Warning Signal

Hong Kong Observatory Warning Signal

The Hong Kong Observatory selects 8 meteorological stations. During a typhoon, the Observatory decides which warning signal to issue based on the sustained wind speeds recorded at these stations. The rules are as follows:

  • Since a typhoon is in effect, a No.1 warning signal is always issued.
  • If at least 4 stations have a sustained wind speed of at least \(41\) km/h, a No.3 strong wind signal is issued.
  • If at least 4 stations have a sustained wind speed of at least \(63\) km/h, a No.8 violent wind signal is issued.
  • If at least 1 station has a sustained wind speed of at least \(118\) km/h, a No.10 hurricane signal is issued.
  • If multiple conditions are met, the highest warning signal number is issued.

Given the wind speed data from 8 meteorological stations, determine which warning signal should be issued.

inputFormat

The input consists of a single line containing 8 integers. Each integer represents the sustained wind speed (in km/h) observed at a meteorological station.

outputFormat

Output a single integer representing the warning signal level that should be issued.

sample

10 20 30 40 50 60 70 80
3