P27876 [洛谷] [GESP Sample Question Level 1] Seconds of the Day
普及-
题目描述

Problem Description

Xiao Ming has just learned the conversion relationships between hours, minutes, and seconds. He wants to know what second of the day a given time represents. Can you write a program to help him?

Input Format

The input consists of a single line containing three integers and a character. The three integers represent the hour, minute, and second of the time; the character can be either a capital letter 'A' indicating morning or a capital letter 'P' indicating afternoon.

Output Format

The output should be a single line containing an integer, representing the second of the day for the input time.

Sample Input and Output

Sample Input #1

0 0 0 A

Sample Output #1

0

Sample Input #2

11 59 59 P

Sample Output #2

86399
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
0 0 0 A
样例输出
0