Problem:
Score : 100 points

Problem Statement

Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.

In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".

The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time.

Constraints

0 \leq A,B \leq 23

A and B are integers.

Input

The input is given from Standard Input in the following format:

A B

Output

Print the hour of the starting time of the contest in 24-hour time.

Sample Input 1

9 12

Sample Output 1

21

In this input, the current time is 9 o'clock, and 12 hours later it will be 21 o'clock in 24-hour time.

Sample Input 2

19 0

Sample Output 2

19

The contest has just started.

Sample Input 3

23 2

Sample Output 3

1

The contest will begin at 1 o'clock the next day.

Solution in Python (3.4.3) (judge verdict: Runtime Error)

n = int(input())
import math
sq = math.sqrt(n)
if isinstance(sq, int):
    print(len(str(sq)))
    quit()
"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""
# n == 1のとき、[1, 1]を返す
def factorization(n):
    
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            #cnt=0
            while temp%i==0:
                #cnt+=1
                temp //= i
                arr.append(i)
            #arr.append([i, cnt])

    if temp!=1:
        #arr.append([temp, 1])
        arr.append(temp)

    if arr==[]:
        #arr.append([n, 1])
        arr.append(n)
    return arr
factor = factorization(n)
if len(factor) == 1:
    print(len(str(n)))
    quit()
first = 1
ans = float('Inf')
for i in range(len(factor) - 1):
    first *= factor[i]
    second = int(n / first)
    #print(first, second)
    ans = min(ans, max(len(str(first)), len(str(second))))
print(ans)