{"extraResources":{"example.01.mu":"TVXzATUNCjc6NDcNCjc6NTYNCjc6NTkNCjg6MDUNCjg6MTMNCg==","example.02.mu":"TVXzATcNCjg6MDANCjg6MTANCjg6MjANCjg6MzANCjg6NDANCjg6NTANCjk6MDANCg==","example.03.mu":"TVXzATMNCjc6MTMNCjc6NDENCjg6MzYNCg=="},"scoring":null,"notes":"In the first test, three alarms at 7:56, 7:59, and 8:05 guarantee that Faina will wake up.\r\n\r\nIn the second test, any time between 8:00 and 9:00 that does not coincide with existing alarms works.\r\n\r\nIn the third test, one possible solution is to set two more alarms at 7:45 and 7:46.","legend":"Faina is going to sleep, but she needs to wake up early tomorrow for a very important contest. She has already set $n$ alarms at different times between 7:00 and 9:00 in the morning.\r\n\r\nHowever, Faina is a deep sleeper. She knows that in order to wake up, she will need to hear at least three alarms within a 10-minute timespan. In other words, for some three alarms, the difference between the first and the last alarm must be 10 minutes or less.\r\n\r\nFaina is not sure if the current set of alarms she has satisfies this condition, and she is worried she might oversleep the contest (and make her teammates angry!). Thus, she wants to set some additional alarms. All new alarms should also be set between 7:00 and 9:00, and all alarms, including the old ones, must be set at different times.\r\n\r\nFind the smallest number of additional alarms Faina has to set to be confident that she will wake up. In~particular, if she can already be sure she'll wake up, the number of additional alarms is $0$.","authorLogin":"tourist","language":"english","timeLimit":2000,"output":"Print the smallest number of additional alarms Faina has to set in order to guarantee waking up.","inputFile":"stdin","outputFile":"stdout","input":"The first line contains a single integer $n$, denoting the number of alarms Faina has set ($1 \\le n \\le 20$).\r\n\r\nThe $i$-th of the following $n$ lines contains the time of the $i$-th alarm in the \\t{h:mm} format ($7 \\le \\mathtt{h} \\le 9$; $00 \\le \\mathtt{mm} \\le 59$; if $\\mathtt{h} = 9$, then $\\mathtt{mm} = 00$). The alarms are given in strictly increasing order of time.\r\n","authorName":"Gennady Korotkevich","sampleTests":[{"output":"0\r\n","input":"5\r\n7:47\r\n7:56\r\n7:59\r\n8:05\r\n8:13\r\n","inputFile":"example.01","outputFile":"example.01.a"},{"output":"1\r\n","input":"7\r\n8:00\r\n8:10\r\n8:20\r\n8:30\r\n8:40\r\n8:50\r\n9:00\r\n","inputFile":"example.02","outputFile":"example.02.a"},{"output":"2\r\n","input":"3\r\n7:13\r\n7:41\r\n8:36\r\n","inputFile":"example.03","outputFile":"example.03.a"}],"name":"False Alarm","interaction":null,"memoryLimit":1073741824,"tutorial":"{\r\n    \\parindent=1cm\r\n    \\begin{tabular}{l@{\\extracolsep{1cm}}l}\r\n         Идея: & Геннадий Короткевич\\\\\r\n         Разработка: & Геннадий Короткевич\\\\\r\n     \\end{tabular}\r\n}\r\n\r\nПереведём время в минуты. Пусть $a_i$~--- число минут от 7:00, на которое установлен $i$-й будильник ($0 \\le a_1 < a_2 < \\ldots < a_n \\le 120$).\r\n\r\nОтвет равен $0$, если для некоторого $i$ верно, что $a_{i+2} - a_i \\le 10$. Это значит, что будильники $i$, $i+1$ и $i+2$ находятся на расстоянии не больше 10 минут и подходят под условие.\r\n\r\nОтвет равен $1$, если для некоторого $i$ верно, что $a_{i+1} - a_i \\le 10$. Это значит, что к будильникам $i$ и $i+1$ можно добавить третий так, чтобы условие выполнялось.\r\n\r\nВ противном случае ответ равен $2$~--- можно взять любой имеющийся будильник и добавить два новых на достаточно небольшом расстоянии от него."}