Harryxun/stf_run huggingface dataset:
s = input()

ans = s.index("S")

print(ans)


### FIXED CODE ###

s = input()

if "RRR" in s:
    print(3)
elif "RR" in s:
    print(2)
elif "R" in s:
    print(1)
else:
    print(0)
S=input()
T=input()
ans=0
for i in range(3):
if S[i]==T[i]:
  ans+=1
print(ans)

### FIXED CODE ###

S=input()
T=input()
ans=0
for i in range(3):
    if S[i]==T[i]:
      ans+=1
print(ans)
N,A = map(int,input().split())
print((N**N)-A)

### FIXED CODE ###

N = int(input())
A = int(input())
print((N**2)-A)
from math import factorial


class Frac(object):
    def __init__(self, a, b):
        self.a = a
        self.b = b

    def eq(self, f):
        return self.a * f.b == f.a * self.b

    def lt(self, f):
        return self.a * f.b > f.a * self.b

    def __repr__(self):
        return '%.6f' % (self.a / self.b)


def nCr(n, r):
    return factorial(n) // factorial(r) // factorial(n - r)


N, A, B = map(int, input().split())
V = list(map(int, input().split()))
V.sort(reverse=True)

res = None
for i in range(A, B+1):
    now = Frac(sum(V[:i]), i)
    if res is None or now.lt(res[0]):
        res = [now]
    elif now.eq(res[0]):
        res.append(now)

cnt = 0
for now in res:
    p = V[:now.b]
    n = len(list(filter(lambda x: x == p[-1], V)))
    r = len(list(filter(lambda x: x == p[-1], p)))
    cnt += nCr(n, r)

print(res[0])
print(cnt)
~

### FIXED CODE ###

class Frac(object):
    def __init__(self, a, b):
        self.a = a
        self.b = b

    def eq(self, f):
        return self.a * f.b == f.a * self.b

    def lt(self, f):
        return self.a * f.b > f.a * self.b

    def __repr__(self):
        return '%.6f' % (self.a / self.b)


def factorial(n):
    res = 1
    for i in range(n):
        res *= i+1
    return res


def nCr(n, r):
    return factorial(n) // factorial(r) // factorial(n - r)


N, A, B = map(int, input().split())
V = list(map(int, input().split()))
V.sort(reverse=True)

res = None
for i in range(A, B+1):
    now = Frac(sum(V[:i]), i)
    if res is None or now.lt(res[0]):
        res = [now]
    elif now.eq(res[0]):
        res.append(now)

cnt = 0
for now in res:
    p = V[:now.b]
    n = len(list(filter(lambda x: x == p[-1], V)))
    r = len(list(filter(lambda x: x == p[-1], p)))
    cnt += nCr(n, r)

print(res[0])
print(cnt)
import math

A, B = map(int, input().split())


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


print(lcm(A, B))

### FIXED CODE ###

import fractions

A, B = map(int, input().split())


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


print(lcm(A, B))
A, B, C, D = map(int, input().split())
print(max(A*B. C*D))

### FIXED CODE ###

A, B, C, D = map(int, input().split())
area1 = A * B
area2 = C * D
print(area1 if area1 >= area2 else area2)
for line in sys.stdin:
	a, b, c, d, e, f = map(float, input().split())
	x = (c * e - f * b) / (a * e - d * b)
	y = (c * d - f * a) / (b * d - e * a)
	print('{0:.3f} {1:.3f}'.format(x, y))

### FIXED CODE ###

import sys

for line in sys.stdin:
	a, b, c, d, e, f = map(float, line.split())
	x = (c * e - f * b) / (a * e - d * b)
	y = (c * d - f * a) / (b * d - e * a)
	if x == 0:
		x = 0
	if y == 0:
		y = 0
	print('{0:.3f} {1:.3f}'.format(x, y))
# Aizu Problem 0221: Fizz Buzz

import sys, math, os, struct

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def valid(k, a):
    if k % 3 == 0 and k % 5 == 0:
        return a == "FizzBuzz"
    elif k % 3 == 0:
        return a == "Fizz"
    elif k % 5 == 0:
        return a == "Buzz"
    else:
        return int(a) == k

    
def fizz_buzz(m, n, A):
    players = list(range(1, m + 1))
    p = 0
    k = 0
    while len(A) > 0:
        k += 1
        a = A.pop(0)
        if valid(k, a):
            p = (p + 1) % m
        else:
            players.pop(p)
            m -= 1
            if p == m:
                p = 0
    print(' '.join([str(p) for p in players]))
    
    
while True:
    m, n = [int(_) for _ in input().split()]
    if m == n == 0:
        break
    A = [input().strip() for _ in range(n)]
    fizz_buzz(m, n, A)

### FIXED CODE ###

# Aizu Problem 0221: Fizz Buzz

import sys, math, os, struct

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def valid(k, a):
    if k % 15 == 0: 
        return a == "FizzBuzz"
    elif k % 3 == 0:
        return a == "Fizz"
    elif k % 5 == 0:
        return a == "Buzz"
    else:
        return a == str(k)

    
def fizz_buzz(m, n, A):
    players = list(range(1, m + 1))
    p = 0
    k = 0
    while len(A) > 0:
        k += 1
        a = A.pop(0)
        if valid(k, a):
            p = (p + 1) % m
        else:
            if len(players) == 0:
                print()
                return
            players.pop(p)
            if len(players) == 1:
                break
            m -= 1
            p %= m
    print(' '.join([str(p) for p in players]))
    
    
while True:
    m, n = [int(_) for _ in input().split()]
    if m == 0:
        break
    A = [input().strip() for _ in range(n)]
    fizz_buzz(m, n, A)
import math
import fractions
l, r, p1, p2 = list(map(int, input().split()))
lcm = p1*p2 // fractions.gcd(p1, p2)
ans = (r-l+1) - (r//p1-(l-1)//p1) - (r//p2)-(l-1)//p2) + (r//lcm)-(l-1)//lcm
print(ans)


### FIXED CODE ###

import math
import fractions
l, r, p1, p2 = list(map(int, input().split()))
lcm = p1*p2 // fractions.gcd(p1, p2)
ans = (r-l+1) - (r//p1-(l-1)//p1) - (r//p2-(l-1)//p2) + (r//lcm)-(l-1)//lcm
print(ans)
n, x, t = map(int, input())

if n % t == 0:
  ans = (n // x) * t
else:
  ans = (n // x + 1) * t

print(ans)

### FIXED CODE ###

n, x, t = map(int, input().split())

if n % x == 0:
  ans = (n // x) * t
else:
  ans = (n // x + 1) * t

print(ans)
N=int(input())
para = [int(input()) for i in range(N)]
para.sort(reverse=True)

"""
全ての最小公倍数を求めたら良い
lcm(a,b,c...) = lcm(a,lcm(b,c.......))
gcd(a,b,c...) = gcd(a,gcd(b,c,d....))
"""

"""
最大公倍数の実装
ユークリッドの互除法
a = b*c + d
c = d*e + f
"""
def gcd(a,b):
    if b == 0 : 
        return a  
    return gcd(b,a%b)

def lcm(a,b) :
    return a*b//gcd(a,b)

for i in range(N-1,0,-1):
    if i == N-1:
        p = lcm(para[i-1],para[i])
    else :
        a = max(para[i],p)
        b = min(para[i],p)
        p = lcm(a,b)
print(p)

### FIXED CODE ###

N=int(input())
para = [int(input()) for i in range(N)]
para.sort(reverse=True)


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

def lcm(a,b) :
    return a*b//gcd(a,b)

for i in range(N-1,-1,-1):
    if i == N-1:
        p = lcm(para[i-1],para[i])
    else :
        a = max(para[i],p)
        b = min(para[i],p)
        p = lcm(a,b)
print(p)
import sys

def replace(a):
	if a=="9":
		return "1"
	elif a=="1":
		return "9"
	else:
		return a
num=sys.argv[1]
num1="".join(map(replace,num))
print(int(num1))



### FIXED CODE ###


def replace(a):
	if a=="9":
		return "1"
	elif a=="1":
		return "9"
	else:
		return a
num=raw_input()
num1="".join(map(replace,num))
print(int(num1))
n = int(input())
xyhs = []
for _ in range(n):
    xyhs.append(tuple(map(int, input().split())))

xyhs = sorted(xyhs, key=lambda v: v[2], reverse=True)

anss = []
for y in range(101):
    for x in range(101):
        x0, y0, h0 = xyhs[0]
        ht0 = h0 + abs(x0 - x) + abs(y0 - y)

        flag = True
        for xyh in xyhs[1:]:
            xi, yi, hi = xyh
            hti = hi + abs(xi - x) + abs(yi - y)
            if hti != ht0:
                flag = False
                break

        if flag:
            anss.append((x, y, ht0))

print(anss[0][0], anss[0][1], anss[0][2])

### FIXED CODE ###

n = int(input())
xyhs = []
for _ in range(n):
    xyhs.append(tuple(map(int, input().split())))

xyhs = sorted(xyhs, key=lambda v: v[2], reverse=True)

anss = []
for y in range(101):
    for x in range(101):
        x0, y0, h0 = xyhs[0]
        ht = h0 + abs(x0 - x) + abs(y0 - y)

        flag = True
        for xyh in xyhs[1:]:
            xi, yi, hi = xyh
            his = max(ht - abs(xi - x) - abs(yi - y), 0)
            if his != hi:
                flag = False
                break

        if flag:
            anss.append((x, y, ht))

print(anss[0][0], anss[0][1], anss[0][2])
def main():
    import sys
    sys.setrecursionlimit(10000)
    h, w, d = map(int, input().split())
    p = []
    for i in range(1, h + 1):
        l = map(int, input().split())
        for j, k in enumerate(l, 1):
            p.append((k, (i, j)))
    p.sort(key=lambda x: x[0])

    q = int(input())

    dist = [0] * (w * h + 1)

    def Q(i, c, x, y):
        if i + d > w * h:
            return
        _, (nx, ny) = p[i + d - 1]
        nc = c + abs(nx - x) + abs(ny - y)
        dist[i + d] = nc
        Q(i + d, nc, nx, ny)

    for i in range(d):
        n, (x, y) = p[i]
        Q(n, 0, x, y)

    res = []
    for _ in range(q):
        l, r = map(int, input().split())
        res.append(dist[r] - dist[l])

    ans = '\n'.join(map(str, res))
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    from itertools import accumulate
    h, w, d = map(int, input().split())

    a = [0] * (h * w + 1)
    b = [0] * (h * w + 1)
    for i in range(1, h + 1):
        l = map(int, input().split())
        for j, k in enumerate(l, 1):
            a[k] = i
            b[k] = j

    c = [0] * (h * w + 1)
    for i in range(d + 1, h * w + 1):
        c[i] = c[i - d] + abs(a[i] - a[i - d]) + abs(b[i] - b[i - d])

    q = int(input())
    res = []
    for _ in range(q):
        l, r = map(int, input().split())
        res.append(c[r] - c[l])

    ans = '\n'.join(map(str, res))
    print(ans)


if __name__ == '__main__':
    main()
from math import factorial

num=int(input())
stl=[]

count=0

for i in range(num):
    str=input()
    str=''.join(sorted(str))
    stl.append(str)

duplicate=[x for x in set(stl) if stl.count(x) > 1]
if duplicate:
    for dup in duplicate:
        n=stl.count(dup)
        count += factorial(n) // 2 // factorial(n - 2)
    
print(count)

### FIXED CODE ###

a,b=(int(x) for x in input().split())

c=a+b
d=a-b
e=a*b

print(max(c,d,e))
n , y= map(int, input().split())

for i in range(n + 1):
    for j in range(n + 1 - i):
            if  10000 * i + 5000 * j + 1000 * k == y:
                print(i, j, n - i - j)
                exit()
                    
print(-1, -1, -1)        

### FIXED CODE ###

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

for i in range(n + 1):
    for j in range(n + 1 - i):
            if  10000 * i + 5000 * j + 1000 * (n - i - j) == y:
                print(i, j, n - i - j)
                exit()
                    
print(-1, -1, -1)
from math import sqrt 

n=int(input())
count=[]

for i in range(1,int(sqrt(n))):
    if n%i==0:
        count.append(i+n/i)

print(int(min(count)-2))


### FIXED CODE ###

from math import sqrt

n=int(input())
count=[]

for i in range(1,int(sqrt(n))+1):
    if n%i==0:
        count.append(i+n/i)

print(int(min(count)-2))
from functools import lru_cache

@lru_cache(None)
def dp(N,A,i,k):
    if k<=0:
        return 0
    tmp=N-i
    if k>(tmp//2)+(tmp%2):
        return -float('inf')
    return max(A[i]+dp(N,A,i+2,k-1),dp(N,A,i+1,k))

def main():
    N=int(input())
    A=[int(_) for _ in input().split()]
    print(dp(N,A,0,N//2))

main()


### FIXED CODE ###

def main():
    N=int(input())
    A=[int(_) for _ in input().split()]
    dp=[[0,0,0] for _ in range(N//2+1)]
    for i in range(N//2):
        dp[i+1][0]=dp[i][0]+A[i*2]
        dp[i+1][1]=max(dp[i][1],dp[i][0])+A[i*2+1]
        if N%2:
            dp[i+1][2]=max(dp[i][2],dp[i][1],dp[i][0])+A[i*2+2]
    if N%2:
        print(max(dp[-1]))
    else:
        print(max(dp[-1][:2]))

main()
a = int(input())
b = int(input())
if a*b % 2 == 0:
    print('Even')
else:
    print('Odd')

### FIXED CODE ###

a, b = map(int, input().split())
if a * b % 2 == 0:
  print('Even')
else:
  print('Odd')
r = int(input())
a = r[0]
b = r[1]
c = r[2]
d = r[3]
if a+b+c+d ==7:
  print(a+"+"+b+"+"+c+"+"+d"=7")
elif a+b+c-d ==7:
  print(a+"+"+b+"+"+c+"-"+d"=7")
elif a+b-c+d ==7:
  print(a+"+"+b+"-"+c+"+"+d"=7")
elif a+b-c-d ==7:
  print(a+"+"+b+"-"+c+"-"+d"=7")
elif a-b+c+d ==7:
  print(a+"-"+b+"+"+c+"+"+d"=7")
elif a-b+c-d ==7:
  print(a+"-"+b+"+"+c+"-"+d"=7")
elif a-b-c+d ==7:
  print(a+"-"+b+"-"+c+"+"+d"=7")
elif a-b-c-d ==7:
  print(a+"-"+b+"-"+c+"-"+d"=7")

### FIXED CODE ###

r = input()
a = int(r[0])
b = int(r[1])
c = int(r[2])
d = int(r[3])
import sys

if a+b+c+d ==7:
  sys.stdout.write(r[0]+"+"+r[1]+"+"+r[2]+"+"+r[3]+"=7")
elif a+b+c-d ==7:
  sys.stdout.write(r[0]+"+"+r[1]+"+"+r[2]+"-"+r[3]+"=7")
elif a+b-c+d ==7:
  sys.stdout.write(r[0]+"+"+r[1]+"-"+r[2]+"+"+r[3]+"=7")
elif a+b-c-d ==7:
  sys.stdout.write(r[0]+"+"+r[1]+"-"+r[2]+"-"+r[3]+"=7")
elif a-b+c+d ==7:
  sys.stdout.write(r[0]+"-"+r[1]+"+"+r[2]+"+"+r[3]+"=7")
elif a-b+c-d ==7:
  sys.stdout.write(r[0]+"-"+r[1]+"+"+r[2]+"-"+r[3]+"=7")
elif a-b-c+d ==7:
  sys.stdout.write(r[0]+"-"+r[1]+"-"+r[2]+"+"+r[3]+"=7")
else:
  sys.stdout.write(r[0]+"-"+r[1]+"-"+r[2]+"-"+r[3]+"=7")
N = int(input())
A = int(input())
B = int(input())
train = A * N
if train <= B:
    print(train)
else:
    print(B)

### FIXED CODE ###

get = input().split()
N = int(get[0])
A = int(get[1])
B = int(get[2])
train = A * N
if train <= B:
    print(train)
else:
    print(B)
string = str(input())

pairs = 0
limit = len(string)-4
secondLimit = len(string)
substringArray = list()
substringArray.append(string[0])
for i in range(1, secondLimit):
  substringArray.append(substringArray[i-1] + string[i])

for i in range(0,limit):
  for j in range(i+3,secondLimit):
    if j-i >= 3 and int(substringArray[j][i:]) % 673 == 0:
      pairs += 1
print(pairs)

### FIXED CODE ###

number = str(input())[::-1]
remainderDictionary = {0: 1}
    
sum = 0
x = 1
for i in number:
  x = (x * 10) % 2019
  sum += int(i) * x
  sum %= 2019
  remainderValue = remainderDictionary.get(sum,0) + 1
  remainderDictionary[sum] = remainderValue
     
ans = 0
for i in remainderDictionary:
  value = remainderDictionary[i]
  ans += value * (value - 1) // 2 # N C 2
print(ans)
x, y, z, k = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)

AB = []
for a in A:
    for b in B:
        AB.append(a + b)

AB.sort(reverse=True)

ABC = []
for i in range(min(x * y, k)):
    for c in C:
        ABC.append(AB[i] + c)

ABC.sort(reverse=True)

for i in range(k):
    print(ABC[i])


### FIXED CODE ###

n = int(input())
c = [int(input()) for i in range(5)]
mc = min(c)
b = n // mc
r =  0 if n % mc == 0 else 1

print(4 + b + r)
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# GCD -- START --
def gcd(x,y):
  while y:
    x,y=y,x%y
  return x
# GCD --- END ---

# LCM -- START --
def lcm(x,y):
  return int(x*y/gcd(x,y))
# LCM --- END ---

def main():
  n=I()
  ans=I()

  for _ in range(n-1):
    ans=lcm(ans,I())

  return ans

# main()
print(main())


### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# GCD -- START --
def gcd(x,y):
  while y:
    x,y=y,x%y
  return x
# GCD --- END ---

# LCM -- START --
def lcm(x,y):
  return x*y//gcd(x,y)
# LCM --- END ---

def main():
  n=I()
  ans=I()

  for _ in range(n-1):
    ans=lcm(ans,I())

  return ans

# main()
print(main())
"""
map(int,input().split())

X = input().split()
x = []
for i in range(0,len(X)):
    x.append(X[i])

"""
def search(l, x):
    if x in l:
        return l.index(x)
    else:
        return -1

N = int(input())

ball = []

for n in range(N):
    x,y = map(int,input().split(" "))
    ball.append((x,y))

#最適p,q計算
pqList = []
pqCount = []
for i in range(0,N):
    for j in range(0,N):
        if i != j:
           i_x = ball[i][0]
           i_y = ball[i][1]
           j_x = ball[j][0]
           j_y = ball[j][1]
           s = search(pqList,(abs(i_x-j_x),abs(i_y-j_y)))
           if s != -1 :
               pqCount[s] += 1
           else:
               pqList.append((abs(i_x-j_x),abs(i_y-j_y)))
               pqCount.append(1)

print(int(N - (max(pqCount)/2)))


### FIXED CODE ###

"""
map(int,input().split())

X = input().split()
x = []
for i in range(0,len(X)):
    x.append(X[i])

"""

def search(l, x):
    if x in l:
        return l.index(x)
    else:
        return -1

N = int(input())



ball = []

for n in range(N):
    x,y = map(int,input().split(" "))
    ball.append((x,y))

if N== 1:
    print(1)
    exit()

#最適p,q計算
pqList = []
pqCount = []
for i in range(0,N):
    for j in range(0,N):
        if i != j:
           i_x = ball[i][0]
           i_y = ball[i][1]
           j_x = ball[j][0]
           j_y = ball[j][1]
           s = search(pqList,(i_x-j_x,i_y-j_y))
           if s != -1 :
               pqCount[s] += 1
           else:
               pqList.append((i_x-j_x,i_y-j_y))
               pqCount.append(1)

print(int(N - (max(pqCount))))
k,x = map(int,input().split())
a = x+k-1
b = x-k+1
l = range(b:a+1)
print(l)


### FIXED CODE ###

k,x = map(int,input().split())
for a in range(x-k+1,x+k):
    print(a ,end=" ")
import itertools
k, s = map(int, input().split())

#data = [i for i in range(k + 1)]
# print(data)
#dd = itertools.product(data, repeat=3)
# print(dd)
#dd = list(dd)
target = s / 3
ans = 0
if (target < k):
    pass
elif:
    for x in range(0, k + 1):
        #temp = s - x
        # 2なら、（０、２）（１、１）（２、０）
        for y in range(0, k + 1):
            if (0 <= s - (x + y) <= k):
                ans += 1


print(ans)

'''
ans = 0
for i in dd:
    #print(sum(i))
    if (sum(i) == s):
        ans += 1

print(ans)
'''


### FIXED CODE ###

import itertools
k, s = map(int, input().split())

#data = [i for i in range(k + 1)]
# print(data)
#dd = itertools.product(data, repeat=3)
# print(dd)
#dd = list(dd)
#target = s / 3
ans = 0
if (k * 3 < s):

    pass
else:
    for x in range(0, k + 1):
        #temp = s - x
        # 2なら、（０、２）（１、１）（２、０）
        for y in range(0, k + 1):
            if (0 <= s - (x + y) <= k):
                ans += 1

print(ans)

'''
ans = 0
for i in dd:
    #print(sum(i))
    if (sum(i) == s):
        ans += 1

print(ans)
'''
import sys
while True:
    x = sys.stdin.readline().strip()
    if x == "0 0":
        break
    a = list(map(int, x.strip()))
    sharp = "#" * a[1]
    for i in range(a[0]):
        print(sharp+"\n")

### FIXED CODE ###

while True:
    a = list(map(int, input().split()))
    if a[0] == a[1] == 0:
        break
    sharp = "#" * a[1]
    for i in range(a[0]):
        print(sharp)
    print()
n = int(input())
a = list(set(map(int, input().split())))
n = len(a)
#a = [746130, 1385670, 4849845, 881790, 3233230, 1939938, 570570, 510510]
#a = [7,6,8]
#n = len(a)
max_value = 0
for i in range(n):
    memo = a.pop(0)
    x = reduce(gcd, a)
    if x > max_value:
        max_value = x
    a.append(memo)
print(max_value)

### FIXED CODE ###

from fractions import gcd
n = int(input())
a = list(map(int,input().split()))
l = [0]
r = [0]
ans = 0
for i in range(n-1):
    l.append(gcd(l[i],a[i]))
for i in range(n-1):
    r.append(gcd(r[i],a[n-1-i]))
for i in range(n):
    ans = max(ans,gcd(l[i],r[-i-1]))
print(ans)
def sum_digits(n):
  sum = 0
  while(n > 0):
    sum += int(n % 10)
    n = n //10
  return sum
   
 
  
def main():
  n, a, b = map(int, input().strip().split())
  total = 0
  for i in range(n+1):
    tmp = sum_digits(n)
    if (tmp >= a) & (tmp <= b):
      total += tmp
  print(total)
 
    
if __name__=="__main__":
  main()
def sum_digits(n):
  sum = 0
  while(n > 0):
    sum += int(n % 10)
    n = (n //10)
  return sum
   
 
  
def main():
  n, a, b = map(int, list(input().strip().split()))
  for i in range(n+1):
    tmp = sum_digits(n)
    if (tmp >= a) & (tmp <= b):
      total += tmp
  print(total)
 
    
if __name__=="__main__":
  main()


### FIXED CODE ###

def sum_digits(n):
  sum_ = 0
  while(n > 0):
    sum_ += (n % 10)
    n = (n // 10)
  return sum_
   
 
  
def main():
  n, a, b = map(int, input().strip().split())
  total = 0
  for i in range(1, n+1):
    tmp = sum_digits(i)
    
    if (tmp >= a) & (tmp <= b):
      total += i
  print(total)
 
    
if __name__=="__main__":
  main()
import itertools


X, Y, Z, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

AB = [a + b for (a, b) in list(itertools.product(A, B))]
AB = sorted(AB)[::-1]
ans = [ab + c for (ab, c) in list(itertools.product(AB[:3000], C))]
ans = sorted(ans)[::-1]
for i in range(K):
    print(ans[i])


### FIXED CODE ###

A = [int(input()) for i in range(5)]
K = int(input())

if (max(A)-min(A) <= K):
    print("Yay!")
else:
    print(":(")
A,B = list(map(float,input().split()))
print(A*(B*100))/100

### FIXED CODE ###

import decimal
import math
A,B = input().split()
A = int(A)
B = decimal.Decimal(B)
print(math.floor(A*B))
N = int(input())
S = [input() for i in range(N)]
print(len(set(d)))

### FIXED CODE ###

N = int(input())
d = [input() for i in range(N)]
print(len(set(d)))
print()
n=int(input())
xyh = [list(map(int,input().split())) for i in range(n)]
ansh=-1
ans=[]
for cx in range(0,101):
  if len(ans)>0:
    break
  for cy in range(0,101):
    if len(ans)>0:
      break
    ansh = -1
    for pira in xyh:
      
      if pira[2] > 0 and ansh == -1:
        ansh = pira[2]+abs(cx-pira[0])+abs(cy-pira[1])
        ans.append([cx,cy,ansh])
      elif pira[2] > 0 and ansh !=pira[2]+abs(cx-pira[0])+abs(cy-pira[1]):
        ans=[]
        break
      elif pira[2]==0 and pira[2]+abs(cx-pira[0])+abs(cy-pira[1])>0:
        ans=[]
        break
print(*ans[0])

    

### FIXED CODE ###

n=int(input())
xyh = [list(map(int,input().split())) for i in range(n)]
xyh.sort(key=lambda x:x[2], reverse=True)

ansh=-1
ans=[[]]
flag=True
for cx in range(0,101):
  if flag==False:
    break
    
  for cy in range(0,101):
    ansh = 0
    for pira in xyh:
      if ansh==0:
        ansh=pira[2]+(abs(cx-pira[0])+abs(cy-pira[1]))
        ans[0]=[cx,cy,ansh]
        
      elif len(ans[0])>0 and max(ansh -(abs(cx-pira[0])+abs(cy-pira[1])), 0) != pira[2]:
        ans[0]=[]
    if len(ans[0])>0:
      flag=False
      break
print(*ans[0])
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

input = raw_input().split(" ")
N = int(input[0])
K = long(input[1])

aVec = raw_input().split(" ")
a = []

for i in aVec:
    a.append(long(i))


VecNum = N * (N + 1) / 2


subarray = []

for i in range(0, N):
    a_bubun = a[i:]
    for k in range(0, len(a_bubun)):
        subarray.append(a_bubun[k:])


#print subarray

beauty = []
for i in subarray:
    beauty.append(sum(i))
beauty.sort(reverse=True)


#K個大きい物を選ぶ
aK = []
for i in range(0, K):
    aK.append(beauty[i])


#論理積の最大値なので、最小値を求める
print min(aK)

### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

input = raw_input()
N = int(input)
aVec = raw_input().split(" ")
a = []

for i in aVec:
    a.append(float(i))


#平均を算出
mean = sum(a) / N

#平均に最も近い値を算出(平均を引いたときの最小値を出す)
near_mean = []

for i in a:
    near_mean.append(abs(i - mean))

#平均値に最も近い値のフレーム番号(0始まり)を出力
#同じ値が複数ある場合は最初のインデックスを返す必要があるが、index関数はそういう仕様なので問題ない
print near_mean.index(min(near_mean))