{"extraResources":{"example.01.mu":"TVXzATI0IDYwDQo="},"scoring":null,"notes":"","legend":"Long ago, in the fairy kingdom of Time, there lived a kind wizard named Nikolay. He adored the magical number 239, which brought him luck and joy every time he saw it on the magical digital clock of the kingdom located at the main square.\r\n\r\nThis wonderful clock displayed time using four digits: two for the hours and two for the minutes. If the number of hours or minutes was less than $10$, a $0$ was placed in the front.\r\n\r\nNikolay can enchant time so that there will be $H$~hours in each day, numbered from~$0$ to~$H - 1$, and $M$~minutes in each hour, numbered from~$0$ to~$M - 1$. For this spell, Nikolay can select any numbers $H$~and~$M$ between~$10$ and~$100$, inclusive.\r\n\r\nThe time shown by the clock is \\textit{lucky} only when the digits resemble the cherished combination 239:\r\n\\begin{itemize}\r\n\\item When the clock shows \\texttt{X2:39}, where the first digit \\texttt{X} can take any value from \\texttt{0} to \\texttt{9}.\r\n\\item  Or \\texttt{2X:39}, where the digit \\texttt{X} can take the value \\texttt{0}, \\texttt{2}, or \\texttt{3} (because \\texttt{0} does not hinder the perception of the magical number).\r\n\\item  Or \\texttt{23:X9}, where the digit \\texttt{X} can take the value \\texttt{0}, \\texttt{3}, or \\texttt{9}.\r\n\\item  Or even \\texttt{23:9X}, where the digit \\texttt{X} can take any value from \\texttt{0} to \\texttt{9}.\r\n\\end{itemize}\r\n\r\nOne day, Nikolay faced the question: ``Given $H$ and $M$, how many minutes in a full day will the clock show a lucky number?'' Help Nikolay find this number.\r\n","authorLogin":"Olympic_Bear","language":"english","timeLimit":1000,"output":"Output the number of minutes in a full day when the clock will show a lucky number.","inputFile":"stdin","outputFile":"stdout","input":"The first line of input contains two integers $H$ and $M$ separated by a space: the number of hours in a day and the number of minutes in an hour ($10 \\le H, M \\le 100$).\r\n","authorName":"Nikolay Dubchuk","sampleTests":[{"output":"6","input":"24 60\r\n","inputFile":"example.01","outputFile":"example.01.a"}],"name":"Time of the Magical Number","interaction":null,"memoryLimit":1073741824,"tutorial":"\\begin{itemize}\r\n\\item You can perform a brute force check and verify each time for its relevance to 239.\r\n\\item You can mathematically calculate how many successful combinations there will be.\r\n\\end{itemize}\r\n"}