2416 - 序列游戏

Input

Output

Examples

Input

63
216
11512
216

Output

0
3
时间限制 1 秒
内存限制 128 MB
统计
上一题 下一题