Harryxun/stf_run huggingface dataset:
x = int(input())

x = tuple(x)

for idx in range(5):
  if x[idx] == 0:
    print(idx + 1)
    break

### FIXED CODE ###

x1, x2, x3, x4, x5 = map(int, input().split())

if x1 == 0:
  print(1)
elif x2 == 0:
  print(2)
elif x3 == 0:
  print(3)
elif x4 == 0:
  print(4)
else:
  print(5)
N = int(input())
T = []
A = []
Nb = 0
for i in range(N):
    a, b = map(int,input().split())
    T.append(a)
    A.append(b)
Tn = 1
An = 1
for i in range(N):
        tmp = max(math.ceil(Tn / T[i]), math.ceil(An / A[i]))
        Tn = T[i] * tmp
        An = A[i] * tmp
print(Tn + An)

### FIXED CODE ###

N = int(input())
T = []
A = []
Nb = 0
for i in range(N):
    a, b = map(int,input().split())
    T.append(a)
    A.append(b)
Tn = 1
An = 1
for i in range(N):
        tmp = max((Tn+T[i]-1) // T[i], (An+A[i]-1) // A[i])
        Tn = T[i] * tmp
        An = A[i] * tmp
print(Tn + An)
import sys
sys.setrecursionlimit(100**6)

def dfs(v, p, g, color, c = 0):
	color[v] = c
	for nv in g[v]:
		if nv[0] == p:
			continue
		nc = c if nv[1] % 2 == 0 else 1 - c
		dfs(nv[0], v, g, color, nc)

def resolve():
	n = int(input())
	color = [-1]*n
	g = [[] for _ in range(n)]
	for i in range(n-1):
		u, v, w = map(int, input().split())
		g[u-1].append([v-1, w])
		g[v-1].append([u-1, w])
	for v in range(n):
		dfs(v, -1, g, color)
	for i in color:
		print(i)
resolve()

### FIXED CODE ###

import sys
sys.setrecursionlimit(100**4)

class Edge():
	def __init__(self, v, w):
		self._v = v
		self._w = w
	def v(self):
		return self._v
	def w(self):
		return self._w

def dfs(v, g, colors, color = 0):
	colors[v] = color
	if not len(g[v]):
		return
	for nv in g[v]:
		if colors[nv.v()] != -1:
			continue
		nc = color if nv.w() % 2 == 0 else 1 - color
		dfs(nv.v(), g, colors, nc)

def resolve():
	n = int(input())
	colors = [-1]*n
	g = [list() for _ in range(n)]
	for _ in range(n-1):
		u, v, w = map(int, input().split())
		g[v-1].append(Edge(u-1, w))
		g[u-1].append(Edge(v-1, w))
	for i in range(n):
		if colors[i] != -1:
			continue
		dfs(i, g, colors)
	for c in colors:
		print(c)
resolve()
import sys
count = 1
While True:
  x = sys.stdin.readlie().atrip()
  if x == "0":
    break
  print("Case %d: %s" %(count,x))
  count = count + 1

### FIXED CODE ###

import sys
count = 1
while True:
  x = sys.stdin.readline().strip()
  if x == "0":
    break
  print("Case %d: %s" %(count,x))
  count = count + 1
import sys
input = sys.stdin.readline
sys.setrecursionlimit(200000)

n, q = map(int, input().split())

root = [[] for _ in range(n+1)]
for i in range(n-1):
    a, b = map(int, input().split())
    root[a].append(b)
    root[b].append(a)
    
cnt = [0 for _ in range(n+1)]
for i in range(q):
    p, x = map(int, input().split())
    cnt[p] += x

def rec(node, parent):
    for i in root[node]:
        if i == parent:
            continue
        cnt[i] += cnt[node]
        rec(i, node)

rec(1, 1)
print(" ".join(map(str, cnt[1:])))

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(300000)

n, q = map(int, input().split())

root = [[] for _ in range(n+1)]
for i in range(n-1):
    a, b = map(int, input().split())
    root[a].append(b)
    root[b].append(a)
    
cnt = [0 for _ in range(n+1)]
for i in range(q):
    p, x = map(int, input().split())
    cnt[p] += x

def rec(node, parent):
    for i in root[node]:
        if i == parent:
            continue
        cnt[i] += cnt[node]
        rec(i, node)

rec(1, 1)
print(" ".join(map(str, cnt[1:])))
from heapq import heappop, heappush


def trace(source, edge_trace):
    v = source
    for i in edge_trace:
        e = edges[v][i]
        yield e
        v = e[1]


def min_cost_flow(source, sink, required_flow):
    res = 0
    while required_flow:
        visited = set()
        queue = [(0, source, tuple())]
        while queue:
            total_cost, v, edge_memo = heappop(queue)
            if v in visited:
                continue
            elif v == sink:
                dist = total_cost
                edge_trace = edge_memo
                break
            for i, (remain, target, cost, _) in enumerate(edges[v]):
                if remain and target not in visited:
                    heappush(queue, (total_cost + cost, target, edge_memo + (i,)))
        else:
            return -1

        aug = min(required_flow, min(e[0] for e in trace(source, edge_trace)))
        required_flow -= aug
        res += aug * dist
        for e in trace(source, edge_trace):
            remain, target, cost, idx = e
            e[0] -= aug
            edges[target][idx][0] += aug
    return res


n, m, f = map(int, input().split())
edges = [[] for _ in range(n)]

for _ in range(m):
    s, t, c, d = map(int, input().split())
    es, et = edges[s], edges[t]
    ls, lt = len(es), len(et)
    es.append([c, t, d, lt])
    et.append([0, s, d, ls])

print(min_cost_flow(0, n - 1, f))

### FIXED CODE ###

INF = float('inf')


def trace_back(sink, predecessors):
    p = predecessors[sink]
    while p is not None:
        v, i = p
        yield edges[v][i]
        p = predecessors[v]


def min_cost_flow(source, sink, required_flow):
    res = 0
    while required_flow:
        dist = [INF] * n
        dist[source] = 0
        predecessors = [None] * n

        while True:
            updated = False
            for v in range(n):
                if dist[v] == INF:
                    continue
                for i, (remain, target, cost, _) in enumerate(edges[v]):
                    new_dist = dist[v] + cost
                    if remain and dist[target] > new_dist:
                        dist[target] = new_dist
                        predecessors[target] = (v, i)
                        updated = True
            if not updated:
                break

        if dist[sink] == INF:
            return -1

        aug = min(required_flow, min(e[0] for e in trace_back(sink, predecessors)))
        required_flow -= aug
        res += aug * dist[sink]
        for e in trace_back(sink, predecessors):
            remain, target, cost, idx = e
            e[0] -= aug
            edges[target][idx][0] += aug
    return res


n, m, f = map(int, input().split())
edges = [[] for _ in range(n)]

for _ in range(m):
    s, t, c, d = map(int, input().split())
    es, et = edges[s], edges[t]
    ls, lt = len(es), len(et)
    es.append([c, t, d, lt])
    et.append([0, s, -d, ls])

print(min_cost_flow(0, n - 1, f))
n, x = (int(i) for i in input().split()) 
a = sorted(list(set([int(i) for i in input().split()])))

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

import functools

if len(a) == 1:
    print(abs(a[0] - x))
    exit()

diff = []
for i in range(len(a)-1):
    diff.append(a[i+1] - a[i])

list_gcd = functools.reduce(gcd, diff)

import bisect

bi_index = bisect.bisect_left(a, x)
if a[bi_index] == x:
    print(list_gcd)
    exit()

if bi_index == 0:
    print(gcd(list_gcd, a[0]-x))
    exit()

if bi_index == len(a):
    print(gcd(list_gcd, x-a[-1]))
    exit()

print(functools.reduce(gcd, [list_gcd, x-a[bi_index-1], a[bi_index]-x ]))


### FIXED CODE ###

n, x = (int(i) for i in input().split()) 
a = sorted(list(set([int(i) for i in input().split()])))

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

import functools

if len(a) == 1:
    print(abs(a[0] - x))
    exit()

diff = []
for i in range(len(a)-1):
    diff.append(a[i+1] - a[i])

list_gcd = functools.reduce(gcd, diff)

import bisect

bi_index = bisect.bisect_left(a, x)
if bi_index == len(a):
    print(gcd(list_gcd, x-a[-1]))
    exit()

if a[bi_index] == x:
    print(list_gcd)
    exit()

if bi_index == 0:
    print(gcd(list_gcd, a[0]-x))
    exit()

print(functools.reduce(gcd, [list_gcd, x-a[bi_index-1], a[bi_index]-x ]))
def main():
    import sys
    input = sys.stdin.buffer.readline
    
    r, c, k = map(int, input().split())
    tizu = [[0 for _ in range(c)] for _ in range(r)]
    for _ in range(k):
        rr, cc, v = map(int, input().split())
        tizu[rr - 1][cc - 1] = v
        
    dp = [[0, 0, 0, 0] for _ in range(r)]
    dp[0][1] = tizu[0][0]
    
    for i in range(r):
        for j in range(c):
            if i != 0:
                tmp = max(dp[j])
                dp[j][0] = tmp
                dp[j][1] = tmp + tizu[i][j]
                dp[j][2] = 0
                dp[j][3] = 0
            if j != 0:
                dp[j][0] = max(dp[j][0], dp[j - 1][0])
                dp[j][1] = max(dp[j][1], dp[j - 1][1], dp[j - 1][0] + tizu[i][j])
                dp[j][2] = max(dp[j - 1][2], dp[j - 1][1] + tizu[i][j])
                dp[j][3] = max(dp[j - 1][3], dp[j - 1][2] + tizu[i][j])
    print(max(dp[-1]))
    
main()

### FIXED CODE ###

def main():
    import sys
    input = sys.stdin.buffer.readline
    
    r, c, k = map(int, input().split())
    tizu = [0 for _ in range(r * c)]
    for _ in range(k):
        rr, cc, v = map(int, input().split())
        tizu[(rr - 1) * c + (cc - 1)] = v
        
    dp = [[0, 0, 0, 0] for _ in range(c)]
    dp[0][1] = tizu[0]
    
    for i in range(r):
        for j in range(c):
            v = tizu[i * c + j]
            if v:
                if i != 0:
                    tmp = max(dp[j])
                    dp[j] = [tmp, tmp + v, 0, 0]
                if j != 0:
                    tmp0 = dp[j - 1][0]
                    tmp1 = dp[j - 1][1]
                    tmp2 = dp[j - 1][2]
                    lst = [max(dp[j][0], tmp0), max(dp[j][1], tmp1, tmp0 + v), max(tmp2, tmp1 + v), max(dp[j - 1][3], tmp2 + v)]
                    dp[j] = lst
            else:
                if i != 0:
                    tmp = max(dp[j])
                    dp[j] = [tmp, 0, 0, 0]
                if j != 0:
                    lst = [max(dp[j][0], dp[j-1][0]), dp[j-1][1], dp[j-1][2], dp[j - 1][3]]
                    dp[j] = lst
    print(max(dp[-1]))
    
main()
N, W = map(int, input().split())
dp = [0]*(W+1)
for i in range(n):
    w, v = map(int, input().split())
    for j in range(W, w-1, -1):
        dp[j] = max(dp[j], dp[j-w] + v)
print(max(dp))

### FIXED CODE ###

N, W = map(int, input().split())
dp = [0]*(W+1)
for i in range(N):
    w, v = map(int, input().split())
    for j in range(W, w-1, -1):
        dp[j] = max(dp[j], dp[j-w] + v)
print(max(dp))
n,x=map(int,input().split())
l=list(map(int,input().split()))
k=0
ans=1
while k<=x:
 k+=l[ans-1]
 if k<=x:
  ans+=1
print(ans)

### FIXED CODE ###

n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
ans=1
while d<=x and ans<=n:
 d+=l[ans-1]
 if d>x:
  break
 else:
  ans+=1
print(min(ans,n+1))
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n = int(input())
graph = [[] for _ in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    graph[a].append(b)
    graph[b].append(a)


def dfs(v, dist, memo):
    memo[v] = dist
    for nv in graph[v]:
        if memo[nv] >= 0:
            continue
        dfs(nv, dist+1, memo)

memo = [-1] * n
dfs(0, 0, memo)

node = 0
dist = 0
for i in range(n):
    if memo[i] > dist:
        dist = memo[i]
        node = i

memo = [-1] * n
dfs(node, 0, memo)

dist = max(memo)
count = dist + 1

dp = [0] * (count+1)
dp[0] = 0
dp[1] = 1
dp[2] = 0
dp[3] = 1
dp[4] = 1


if count >= 5:
    for i in range(5, count+1):
        if dp[i-2] == 1 and dp[i-1] == 1:
            dp[i] = 0
        else:
            dp[i] = 1

if dp[count]:
    print("First")
else:
    print("Second")



### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n = int(input())
graph = [[] for _ in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    graph[a].append(b)
    graph[b].append(a)


def dfs(v, dist, memo):
    memo[v] = dist
    for nv in graph[v]:
        if memo[nv] >= 0:
            continue
        dfs(nv, dist+1, memo)

memo = [-1] * n
dfs(0, 0, memo)

node = 0
dist = 0
for i in range(n):
    if memo[i] > dist:
        dist = memo[i]
        node = i

memo = [-1] * n
dfs(node, 0, memo)

dist = max(memo)
count = dist + 1

dp = [0] * (count + 10)
dp[0] = 0
dp[1] = 1
dp[2] = 0
dp[3] = 1
dp[4] = 1


if count >= 5:
    for i in range(5, count+1):
        if dp[i-2] == 1 and dp[i-1] == 1:
            dp[i] = 0
        else:
            dp[i] = 1

if dp[count]:
    print("First")
else:
    print("Second")
import numpy as np
N = int(input())

word_list = []
for i in range(N):
    S = list(input())
    words, count = np.unique(S, return_counts=True)
    word_list.append(''.join(words)+str(count))

S, ans_count = np.unique(word_list, return_counts=True)
temp = ans_count[ans_count>1]
ans = int(sum([t*(t-1)/2 for t in temp]))
print(ans)


### FIXED CODE ###

import collections

N = int(input())

word_list = []
for i in range(N):
    S = list(input())
    c = collections.Counter(sorted(S))
    count = c.values()
    words = c.keys()
    word_list.append(''.join(words)+str(count))

ans_dict = collections.Counter(word_list)
ans_count = list(ans_dict.values())
temp = [i for i in ans_count if i>1]
ans = int(sum([t*(t-1)/2 for t in temp]))
print(ans)
def attk(HP,Magic,D0):
    T = HP // Magic[0][0]
    MD0 = T * Magic[0][1]
    MD1 = (T+1) * Magic[0][1]
    Z = HP % Magic[0][0]
    ND = Magic[0][1]
    if Z == 0:
        return MD0
    if len(Magic) == 1:
        return MD1
    Magic.pop(0)
    A = attk(Z,Magic,ND)
    if D0 > MD0+A:
        if MD1 > MD0+A:
            return MD0+A
        else:
            return MD1
    else:
        return D0


H,N = map(int,input().split())
A =[]
for i in range(N):
    a,b = map(int,input().split())
    A.append((a,b,a/b))
#print(A)
B = sorted(A, key=lambda s: s[1]) 
C = sorted(B, key=lambda s: s[2], reverse=True) 
#print(C)

for i in range(N-1):
    if C[N-1-i][2] ==C[N-2-i][2]:
        C.pop(N-1-i)
#print(C)
TDMAX = (H // C[0][0])*C[0][1]
if (H%C[0][0])!=0:
    TDMAX += C[0][1]
TD = attk(H,C,TDMAX)
print(TD)

### FIXED CODE ###

H,N = map(int,input().split())
Magic =[]
A =[]
E =[]
for i in range(N):
    a,b = map(int,input().split())
    Magic.append((a,b))
    A.append(a)
    E.append(a/b)
MAX_A = H+max(A)
E_MIN = min(E)
WORST = int(MAX_A/E_MIN) +2
#print(Magic)
#print(MAX_A)
#print(WORST)
DP = [[WORST] * (MAX_A+1) for i in range(N)]
for i in range(N):
    if i == 0:
        for j in range(1,MAX_A//Magic[0][0]+1):
            DP[0][j*Magic[0][0]] = Magic[0][1]*j
    else:
        for j in range(Magic[i][0]-1):
            DP[i][j] = DP[i-1][j]
        DP[i][Magic[i][0]] = min(DP[i-1][Magic[i][0]],Magic[i][1])
        for j in range(Magic[i][0]+1,(MAX_A+1)):
            DP[i][j]=min(DP[i-1][j],DP[i-1][j-Magic[i][0]]+Magic[i][1],DP[i][j-Magic[i][0]]+Magic[i][1])
            if j % Magic[i][0] == 0:
                DP[i][j]=min(DP[i][j],((j//Magic[i][0]) * Magic[i][1]))
print(min(DP[N-1][H:MAX_A]))
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()
for i in t:
	for j in s:
		if int(i)==int(j):
			c +=1
			break
print(c


### FIXED CODE ###

c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()

print(len(set(s)&set(t)))
s = list(map(int, input().sprit()))
t = list(map(int, input().sprit()))
ans = 0
for i in range(3):
    if(s[i] == t[i]):
        ans += 1
print(ans)


### FIXED CODE ###

s1 = input()
s2 = input()
s1_list = list(s1)
s2_list = list(s2)
ans = 0
for i in range(3):
    if(s1_list[i] == s2_list[i]):
        ans += 1
print(ans)
from collections import defaultdict
N, M = map(int, input().split())
d = defaultdict(lambda : "WA")
correct = 0
incorrect = 0
for _ in range(M):
    p, S = input().split()
    if d[p] == "WA":
        if S == "WA":
            incorrect += 1
            print(p, "WA", d)
        else:
            correct += 1
            d[p] = "AC"
            print(p, "AC", d)
print(correct, incorrect)

### FIXED CODE ###

N, M = map(int, input().split())
ac = 0
wa = 0
mp = [0]*N
for _ in range(M):
    p, S = input().split()
    p = int(p) - 1
    if S == "AC":
        if mp[p] != "AC":
            ac += 1
            wa += mp[p]
            mp[p] = "AC"
    else:
        if mp[p] != "AC":
            mp[p] += 1
print(ac, wa)
S = input()
L=len(S)
ans='No'
    if S[:(L-1)/2+1]==S[(L-1)/2+1::-1] and S[L+3/2:]==S[:(L+3/2)-1:-1]:
    ans='Yes'
print(ans)

### FIXED CODE ###

n,m = map(int, input().split())
a=n*(n-1)//2+m*(m-1)//2
print(a)
l,r = map(int, input().split())
L = []
for i in range(l,r-1):
  for j in range(i+1,r):
    a = i*j
    b = a%2019
    l.append(b)
print(min(l))

### FIXED CODE ###

l,r = map(int, input().split())
if r-l+1>2019:
  print(0)
  exit()
L = []
for i in range(l,r):
  for j in range(i+1,r+1):
    a = i*j
    b = a%2019
    L.append(b)
print(min(L))
import math
a,b,x = map(int,input().split())
y = (a**2)*b
h = x/(a**2)

def get_angle_from_sides(a, b, c):
    return math.acos((a ** 2 + b ** 2 - c ** 2) / (2 * a * b))

def checkio(a, b, c):
    try:
        angles = [get_angle_from_sides(*abc) for abc in ((a, b, c), (b, c, a), (c, a, b))]
        result = sorted((math.degrees(a)) for a in angles)
        return [0, 0, 0] if 0 in result else result
    except ValueError:
        return [0, 0, 0]
count = 0
if y/2 <=x:
  if a>=2*(b-h):
    m = checkio(a,2*(b-h),math.sqrt(a**2+(2*(b-h))**2))
    count = m[0]
  elif a<2*(b-h):
    m = checkio(a,2*(b-h),math.sqrt(a**2+(2*(b-h))**2))
    count = m[1]
elif y/2>x:
  z = 2*x/(a*b)
  if b>=z:
    m = checkio(b,z,math.sqrt(b**2+(z)**2))
    count = m[1]
  elif b<z:
    m = checkio(b,z,math.sqrt(b**2+(z)**2))
    count = m[0]
#print(a,2*(b-h),math.sqrt(a**2+2*(b-h)**2),m)
print(count)

### FIXED CODE ###

import math
a,b,x = map(int,input().split())
y = (a**2)*b
h = x/(a**2)

def get_angle_from_sides(a, b, c):
    return math.acos((a ** 2 + b ** 2 - c ** 2) / (2 * a * b))

def checkio(a, b, c):
    try:
        angles = [get_angle_from_sides(*abc) for abc in ((a, b, c), (b, c, a), (c, a, b))]
        result = sorted((math.degrees(a)) for a in angles)
        return [0, 0, 0] if 0 in result else result
    except ValueError:
        return [0, 0, 0]
count = 0
if y == x:
  pass
elif y/2 <=x:
  if a>=2*(b-h):
    m = checkio(a,2*(b-h),math.sqrt(a**2+(2*(b-h))**2))
    count = m[0]
  elif a<2*(b-h):
    m = checkio(a,2*(b-h),math.sqrt(a**2+(2*(b-h))**2))
    count = m[1]
elif y/2>x:
  z = 2*x/(a*b)
  if b>=z:
    m = checkio(b,z,math.sqrt(b**2+(z)**2))
    count = m[1]
  elif b<z:
    m = checkio(b,z,math.sqrt(b**2+(z)**2))
    count = m[0]
#print(a,2*(b-h),math.sqrt(a**2+2*(b-h)**2),m)
print(count)
A, B, C, K = inpl()
if A >= K:
    print(K)
    exit()
if A+B >= K:
    print(A)
    exit()
print(A-(K-A-B))

### FIXED CODE ###

from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

A, B, C, K = inpl()
if A >= K:
    print(K)
    exit()
if A+B >= K:
    print(A)
    exit()

print(A - (K-A-B))
def int_raw():
    return int(raw_input())

def ss_raw():
    return raw_input().split()

def ints_raw():
    return map(int,ss_raw())

INF = 1<<29

DIV = 10**9+7

def make2d_arr(w,h,val =INF):
    return [[val]*w for i in xrange(h)]

def floyd_warshall(costs):
    N = len(costs)
    for k in xrange(N):
        for i in xrange(N):
            for j in xrange(N):
                costs[i][j]  = min(costs[i][j],costs[i][k]+costs[k][j])
    return costs

N = int_raw()
C =[]
dp = [0 for i in xrange(N)]

for i in xrange(N):
    c = int_raw()
    C.append(c)
dp[0] =1
dp[1] =1

for x in xrange(2,N):
    cx = C[x]
    dp[x] = dp[x-1]
    if cx == C[x-1]:
        continue
    for y in xrange(x-2,-1,-1):
        cy = C[y]
        if cx == cy:
            dp[x]+=dp[y]
            dp[x]= dp[x]%DIV
            break

print dp[-1] 





### FIXED CODE ###

def int_raw():
    return int(raw_input())

def ss_raw():
    return raw_input().split()

def ints_raw():
    return map(int,ss_raw())

INF = 1<<29

DIV = 10**9+7

def make2d_arr(w,h,val =INF):
    return [[val]*w for i in xrange(h)]

def floyd_warshall(costs):
    N = len(costs)
    for k in xrange(N):
        for i in xrange(N):
            for j in xrange(N):
                costs[i][j]  = min(costs[i][j],costs[i][k]+costs[k][j])
    return costs

N = int_raw()
C =[]
dp = [0 for i in xrange(N)]

m_prev = {}
prevs = [-1 for i in xrange(N)]

for i in xrange(N):
    c = int_raw()
    C.append(c)
    if c in m_prev:
        prevs[i] = m_prev[c]
        m_prev[c]= i
    else:
        m_prev[c]=i
    
dp[0] =1

for x in xrange(1,N):
    cx = C[x]
    dp[x] = dp[x-1]
    if cx == C[x-1]:
        continue
    y = prevs[x]
    if y != -1:
        dp[x]+=dp[y]
        dp[x]= dp[x]%DIV        
    """for y in xrange(x-2,-1,-1):
        cy = C[y]
        if cx == cy:
            dp[x]+=dp[y]
            dp[x]= dp[x]%DIV
            break"""

print dp[-1]
N = int(input())
S = input()

List_S = list(S)
Ans = 1

for i in range(N-1):
    if List_S[i] != List_S[i+1]:
        Ans += 1
    
print(Ans)


### FIXED CODE ###

A,B = input().split()

C = int(A) - int(B) * 2

if C < 1:
    print(0)
elif C > 100:
    print(100)
else:
    print(C)
S = list(input())
T = list(input())
s = 0
for i in range(3):
  if S[i] = T[i]:
    s += 1
print(s)
  


### FIXED CODE ###

s = list(input())
t = list(input())
u = 0
for i in range(3):
  if s[i] == t[i]:
    u += 1
print(u)
S=input()
T=input()
def check(i):
    flag=True
    for j in range(len(T)):
        if S[i+j]!='?' and S[i+j]!=T[j]:
            flag=False
            break
    return flag
def search(S,T):
    for i in range(len(S)-len(T),-1,-1):
        if check(i):return i
    return -1
def main(S,T):
    ans=''
    if T not in S:
        idx=search(S,T)
        if idx==-1:
            return 'UNRESTORABLE'
    S=S[:idx]+T+S[idx+len(T):]
    for s in S:
        if s=='?':ans+='a'
        else:ans+=s
    return ans
print(main(S,T))

### FIXED CODE ###

#ABC076C
s=input()
t=input()
can=[]
for i in range(1+len(s)-len(t)):
    check=0
    for j in range(len(t)):
        if s[i+j]!=t[j] and s[i+j]!='?':
            check=1
            break
    if check==0:can.append(i)
if len(can)==0:print('UNRESTORABLE')
else:
    ans=can[-1]
    res=s[:ans]+t+s[ans+len(t):]
    print(res.replace('?','a'))
import math

a, b, c, d = list(map(int, input().split()))
lcm = math.floor((c * d) / math.gcd(c, d))

b_c_cnt = math.floor(b / c)
b_d_cnt = math.floor(b / d)
b_lcm_cnt = math.floor(b / lcm)

b_cnt = b - (b_c_cnt + b_d_cnt) + b_lcm_cnt

a_c_cnt = math.floor(a / c)
a_d_cnt = math.floor(a / d)
a_lcm_cnt = math.floor(a / lcm)

a_cnt = a - (a_c_cnt + a_d_cnt) + a_lcm_cnt

if (a % c != 0 and a % d != 0):
    print(b_cnt - a_cnt + 1)
else:
    print(b_cnt - a_cnt)


### FIXED CODE ###

def gcd(a, b):
    if (a == 0):
        return b
    elif (b == 0):
        return a
    elif (a == b):
        return a
    elif (a < b):
        return gcd(a, (b % a))
    else:
        return gcd(b, (a % b))


a, b, c, d = list(map(int, input().split()))
lcm = (c * d) // gcd(c, d)

b_c_cnt = b // c
b_d_cnt = b // d
b_lcm_cnt = b // lcm

b_cnt = b - (b_c_cnt + b_d_cnt) + b_lcm_cnt

a_c_cnt = a // c
a_d_cnt = a // d
a_lcm_cnt = a // lcm

a_cnt = a - (a_c_cnt + a_d_cnt) + a_lcm_cnt

if (a % c != 0 and a % d != 0):
    print(b_cnt - a_cnt + 1)
else:
    print(b_cnt - a_cnt)
string = abcdefghijklmnopqrstuvwxyz
s = input()

for i in range(27):
    if string[i] not in s:
        print(string[i])
        exit()

print("None")

### FIXED CODE ###

tester = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
s = input()

for i in tester:
    if i not in s:
        print(i)
        exit()

print("None")