{"raw_statement":[{"iden":"statement","content":"You have a clock that tells time in the usual way: hours, minutes, and seconds. When you wake up in the morning, you want to figure out how many seconds you slept for. Conveniently, you fell asleep the night before at exactly 12:00 AM. Remember that there are 60 seconds in a minute and 60 minutes in an hour.\n\nThe first line of input contains a positive integer _h_ indicating the current number of hours displayed on the clock (_1_ <= _h_ <= _11_). The second line of input contains a positive integer _m_ indicating the current number of minutes displayed on the clock (_0_ <= _m_ <= _59_) The third line of input contains a positive integer _s_ indicating the current number of seconds displayed on the clock (_0_ <= _s_ <= _59_) The fourth line of input contains a string _a_ indicating whether it is currently the morning or the afternoon. _a_ will be either _AM_ or _PM_. You are guaranteed to have slept for less than 24 hours. Also, note that _h_ will never equal 12.\n\nPrint a single positive integer _t_: the number of seconds of sleep that you got.\n\n"},{"iden":"input","content":"The first line of input contains a positive integer _h_ indicating the current number of hours displayed on the clock (_1_ <= _h_ <= _11_). The second line of input contains a positive integer _m_ indicating the current number of minutes displayed on the clock (_0_ <= _m_ <= _59_) The third line of input contains a positive integer _s_ indicating the current number of seconds displayed on the clock (_0_ <= _s_ <= _59_) The fourth line of input contains a string _a_ indicating whether it is currently the morning or the afternoon. _a_ will be either _AM_ or _PM_. You are guaranteed to have slept for less than 24 hours. Also, note that _h_ will never equal 12."},{"iden":"output","content":"Print a single positive integer _t_: the number of seconds of sleep that you got."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ h \\in \\mathbb{Z} $ be the current hour ($1 \\leq h \\leq 11$).  \nLet $ m \\in \\mathbb{Z} $ be the current minute ($0 \\leq m \\leq 59$).  \nLet $ s \\in \\mathbb{Z} $ be the current second ($0 \\leq s \\leq 59$).  \nLet $ a \\in \\{\\text{AM}, \\text{PM}\\} $ be the period indicator.\n\n**Constraints**  \n1. $ 1 \\leq h \\leq 11 $  \n2. $ 0 \\leq m \\leq 59 $  \n3. $ 0 \\leq s \\leq 59 $  \n4. $ a \\in \\{\\text{AM}, \\text{PM}\\} $  \n5. Sleep duration < 24 hours  \n\n**Objective**  \nCompute the total seconds slept, starting from 12:00 AM:  \n$$\nt = \n\\begin{cases}\n3600h + 60m + s & \\text{if } a = \\text{AM} \\\\\n3600(h + 12) + 60m + s & \\text{if } a = \\text{PM}\n\\end{cases}\n$$","simple_statement":"You fell asleep at 12:00 AM. Given the current time (hours, minutes, seconds, and AM/PM), calculate how many seconds you slept.","has_page_source":false}