Valentine Algorithm Cup 2015
A. Valentine's Present
time limit per test
1 second
memory limit per test
64 megabytes
input
stdin
output
stdout

Shokri is at a number store and wants to buy his love, Shakira a present for valentine's day (of course a number).

He knows that Shakira, only loves a number if and only if it's a multiply of holy number 31 .

The salesman recommended him a number n, and unfortunately Shokri is unable to check if Shakira loves it.

Your tasks is to accept the number n, if and only if Shakira will love it, using language Autolan.

Your program's order mustn't exceed 107 .

Input

Input is a number n, 1 ≤ n ≤ 101000 .

Output

Your program should accept the number n, if and only if Shakira will love it, using language Autolan.

Examples
Input
31
Output
Accepted
Input
31294034
Output
Rejected
Input
31294035
Output
Accepted
B. Valentine's Restaurant
time limit per test
1 second
memory limit per test
64 megabytes
input
stdin
output
stdout

Peyman wants to take his love, Kimia to a modern restaurant, MaInHameRahUmadim on Valentine's day. The are n tables there. Each table has some subtables. Their graph forms a rooted forest (each component forms a rooted tree). Kimia just wondered, what's the number of connected components in this graph ? Peyman is lazy and also he wants everything to be perfect. So he asked you to answer him.

As you know, we can show a rooted forest with a proper sequence of [ and ]. Here, each vertex has an interval (a [ and its match) and a vertex is an ancestor of another vertex, if the other vertex's interval is inside it's interval.

You are given this forest as a string with [ and ] . You should write a program using Prolan language that it's input is the forest, and it's output is the number of components (an integers), without leading zero .

Your program's order mustn't exceed 107 .

Input

A proper sequence of [ and ], s .

1 ≤ |s| ≤ 1000

Output

An integer.

Examples
Input
[][[[]][][][][[]]][]
Output
3
Input
[[]][][[[[[]]]]][[][][]][[][][]]
Output
5
Input
[]
Output
1
C. Valentine's Wedding
time limit per test
1 second
memory limit per test
64 megabytes
input
stdin
output
stdout

Pashmak and Parmida are getting married this valentine. Pashmak has invited a guests to the wedding and Parmida has invited b guests. Unfortunately, they are making out and have no time to calculate the number of guests.

Your task is to calculate the number of guests (a + b) with language Cursle.

Your program's order mustn't exceed 107 .

Input

A single string, Ba + bE (B and E are just B and E characters) .

1 ≤ a, b ≤ 101000 (Of course Pashmak and Parmida don't come from earth)

Output

A single integers, c where c = a + b (without characters B and E) .

Examples
Input
B10+3E
Output
13
Input
B4+6E
Output
10
D. Valentine's Cake
time limit per test
1 second
memory limit per test
64 megabytes
input
stdin
output
stdout

Rasta has bought a cake for valentine's day. He knows that his love, Rosita loves number a and he, himself loves number b. So he want to cut the cake into c pieces where c is the greatest number that a and b are both multiplies of c .

Your task is to write a program with language DIT, and storages a b 0 0 calculates number c and put it in storage number 1 (the other storages don't matter).

Your program's order mustn't exceed 2 * 107 .

Input

The numbers in the storages are a b 0 0 in order.

1 ≤ a, b ≤ 105

Output

c should be in the first storage.

Examples
Input
1 5 0 0
Output
1
Input
6 8 0 0
Output
2
E. Valentine's Exam
time limit per test
1 second
memory limit per test
64 megabytes
input
stdin
output
stdout

Saleh was hanging out hole Valentine's day with his love, Sahel. Today is February 15 and he has a mathematics exam and he doesn't know anything about prime decomposition. He is not an idiot and he can figure out how to decompose a number into primes, but right now he can't focus and the only thing he can do is singing in his head,

"I don't know you,  but I need more time

Promise me you'll be mine

Birds are flying over Europe's skies

Tell me please why can't I?..."

He asked you to help him and given storages n 0 0 0 using IDXT language calculate the following number and put it in the first storage :

where and p1 < p2 < ... < pk and for each i, pi is a prime number.

Your program's order mustn't exceed 107 .

Input

Storages with values n 0 0 0 in order.

1 ≤ n ≤ 105

Output

The first storage should contain the answer.

Examples
Input
8 0 0 0
Output
3
Input
200 0 0 0
Output
5
F. Valentine's Candles
time limit per test
1 second
memory limit per test
64 megabytes
input
stdin
output
stdout

It's valentine's day and everyone wants to have a romantic night. Nima, our hero is also one of this people and want's to decorate his place to have a romantic night with his love, Ghazal .

So, he went to CANDLE store (a special store that only sells candles). The store has only n candles and there are some customers there (including Nima). A customer would be happy if he/she buys exactly m candles. The salesman wants to make as much as customers as possible happy.

You should calculate this number using language Prolan.

Your program's order mustn't exceed 107 .

Input

n / m = ?

1 ≤ n, m ≤ 10100

Output

A single integer, the answer.

Examples
Input
100/5=?
Output
20
Input
13/3=?
Output
4
Input
4/5=?
Output
0