Harryxun/stf_run huggingface dataset:
H, W = list(map(int, input()))
h, w = list(map(int, input()))

total = H * W
black = h * W + H * w - h * w
white = total - black
print(white)

### FIXED CODE ###

H, W = list(map(int, input().split()))
h, w = list(map(int, input().split()))

total = H * W
black = h * W + H * w - h * w
white = total - black
print(white)
import itertools
N, Q, row, col = input(), [], range(8), range(8)
for _ in range(N):
    r, c = map(int, raw_input().split())
    Q.append((r, c))
    row.remove(r)
    col.remove(c)
for l in itertools.permutations(col):
    queen = Q + list(zip(row, l))
    if not any((r1 != r2 or c1 != c2) and (r1 == r2 or c1 == c2 or r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2) for r2, c2 in queen for r1, c1 in queen):
        print '\n'.join(''.join('Q' if (r, c) in queen else '.' for c in range(8)) for r in range(8))
        break

### FIXED CODE ###

import itertools
N, Q, row, col = input(), [], range(8), range(8)
for _ in range(N):
    r, c = map(int, raw_input().split())
    Q.append((r, c))
    row.remove(r)
    col.remove(c)
for l in itertools.permutations(col):
    queen = Q + list(zip(row, l))
    if not any((r1 != r2 or c1 != c2) and (r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2) for r2, c2 in queen for r1, c1 in queen):
        print '\n'.join(''.join('Q' if (r, c) in queen else '.' for c in range(8)) for r in range(8))
        break
# A - Good Integer
#  標準入力N

N = input()
my_list = []
j = 0

for i in N:
    my_list.append(i)

if my_list[1] == my_list[2] == my_list[3] or my_list[2] == my_list[3] == my_list[4]:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

# A - Good Integer
#  標準入力N

N = input()
my_list = []
j = 0

for i in N:
    my_list.append(i)

if my_list[0] == my_list[1] == my_list[2] or my_list[1] == my_list[2] == my_list[3]:
    print('Yes')
else:
    print('No')
def printing(a_start, a_2, n):
  a_3 = []
  mod_list = []
  
  for i in range(len(a_2)):
    if (a_2[i][1] % a_start[1] not in mod_list) and (a_2[i][1] % a_start[1] != 0):
      a_3.append(a_2[i])
      mod_list.append(a_2[i][1] % a_start[1])
  
  a_3.sort(key=lambda x: x[1], reverse=True)
  if len(a_3) >= 2:
    if a_start[0] + a_3[-1][0] < n and a_3[0][0] < a3[1][0] and a_3[1][0] > a_start[0]:
      a_3.pop()

  ans = ""
  while n % a_start[1] != 0:
    for i in range(len(a_3)):
      if n % a_start[1] >= a_3[i][1] % a_start[1]:
        n -= a_3[i][1]
        ans += str(a_3[i][0])
        break
      elif n % a_start[1] == 0:
        break
    else:
      n -= a_3[0][1]
      ans += str(a_3[0][0])
      
  ans = ans + str(a_start[0]) * (n // a_start[1])
  ans_list = sorted([ans[i] for i in range(len(ans))], reverse=True)
  print(''.join(ans_list))

  
def main():
  N, M = map(int, input().split())
  a = list(map(int, input().split()))
  a.sort(reverse=True)
  num = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
  a_list = []
  a_2 = []
  
  for i in range(M):
    if num[a[i]] not in a_list:
      a_2.append([a[i], num[a[i]]])
      a_list.append(num[a[i]])

  a_2.sort(key=lambda x: x[1])
  a_start = a_2.pop(0)
  printing(a_start, a_2, N)
      

if __name__ == '__main__':
  main()

### FIXED CODE ###

def printing(a_start, a_2, n):

    a_3 = []
    mod_list = []
    for i in range(len(a_2)):
        if a_2[i][1] % a_start[1] not in mod_list and a_2[i][1] % a_start[1] != 0:
            a_3.append(a_2[i])
            mod_list.append(a_2[i][1] % a_start[1])
    a_3.sort(key=lambda x: x[1], reverse=True)


    if len(a_3) >= 2:
        if a_start[0] + a_3[-1][0] < n and a_3[0][0] < a_3[1][0] and a_3[1][0] > a_start[0]:
            a_3.pop(0)


    ans = ""
    while n % a_start[1] != 0:
        for i in range(len(a_3)):
            if n % a_start[1] >= a_3[i][1] % a_start[1]:
                n -= a_3[i][1]
                ans += str(a_3[i][0])
                break
            elif n % a_start[1] == 0:
                break
        else:
            n -= a_3[0][1]
            ans += str(a_3[0][0])

    ans = ans + str(a_start[0]) * (n // a_start[1])
    ans_list = sorted([ans[i] for i in range(len(ans))], reverse=True)
    print("".join(ans_list))

def main():
    n, m = [int(i) for i in input().split()]
    a = sorted([int(i) for i in input().split()], reverse=True)
    number = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
    a_list = []
    a_2 = []

    for i in range(m):
        if number[a[i]] not in a_list:
            a_2.append([a[i], number[a[i]]])
            a_list.append(number[a[i]])
    a_2.sort(key=lambda x: x[1])
    a_start = a_2.pop(0)
    printing(a_start, a_2, n)

main()
N = int(input())
M = int(input())

sum = 0

for i in range(1,M+1):
    sum += int(input())

if(N >= sum):
    print(N - sum)
else:
    print(-1)

### FIXED CODE ###

N,M = map(int, input().split())

a = [int(M) for M in input().split()]

if(N >= sum(a)):
    print(N - sum(a))
else:
    print(-1)
a,b = [int(i) for i in input().split()]
print(a*b)
print((a*2+b*2) 

### FIXED CODE ###

a,b = [int(i) for i in input().split()]
print(a*b,a*2+b*2)
a,b,c,k=map(int,input().split()),int(input())
print(max(a**k+b+c,a+b**k+c,a+b+c**k))

### FIXED CODE ###

a,k = list(map(int,input().split())),int(input())
print(sum(a)+max(a)*2**k-max(a))
N, K, Q = map(int, input().strip().split())
ansl = [int(input().strip()) for _ in range(Q)]
countl = Counter(ansl)
sumansl = sum(countl.values())
for i in range(N):
    print('Yes') if sumansl-countl[i+1] < K else print('No')

### FIXED CODE ###

from collections import Counter
N, K, Q = map(int, input().strip().split())
ansl = [int(input().strip()) for _ in range(Q)]
countl = Counter(ansl)
sumcountl = sum(countl.values())
for i in range(N):
    print('Yes') if sumcountl-countl[i+1] < K else print('No')
from collectiojns import deque
n=int(input())
a=list(map(int,input().split()))
b=deque()

for i in range(n):
  b.append(a[i])
  b=[b::-1]
print(*b)

### FIXED CODE ###

N=int(input())
A=list(input().split())
s = " ".join(A[::-2]) + " " + " ".join(A[N%2::2])
print(s)
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=sorted(a)
ans=0
for i in range(1,k+1):
  ans+=b[(-1)*i]
print(ans)


### FIXED CODE ###

a,b=map(int,input().split())
if a*b*(a+b)%3==0:
  print("Possible")
else:
  print("Impossible")
import sys
for line in sys.stdin:
    p = line.strip('\n').index()
    a,b = line[:p],line[p+1:]
    a,b = int(a),int(b)
    print '%d %d %.12f' %(a/b, a%b, 1.0*a/b)

### FIXED CODE ###

a, b = map(int, raw_input().split())
print '%d %d %.12f' %(a/b, a%b, 1.0*a/b)
s = list(input())
answer = []

for i range s:
        if  i == "B":
            try:
                answer.pop()
            except:
                pass
        else:
            answer.append(i)

print(" ".join(answer))

### FIXED CODE ###

s = list(input())
answer = []

for i in s:
        if  i == "B":
            try:
                answer.pop()
            except IndexError:
                pass
        else:
            answer.append(i)

print("".join(answer))
a, b = map(int, input().split())

print(6 - (a + b))

### FIXED CODE ###

a = int(input())
b = int(input())

print(6 - (a + b))
from decimal import Decimal
from sys import stdin
def LD(): return list(map(Decimal,stdin.readline().rstrip().split()))
 
tmp = LD()
ans = int(a*b)
print(ans)

### FIXED CODE ###

from decimal import Decimal
from sys import stdin
def LD(): return list(map(Decimal,stdin.readline().rstrip().split()))
 
tmp = LD()
ans = int(tmp[0]*tmp[1])
print(ans)
import collections
from math import factorial

N = int(input())
S = [0]*N
for i in range(N):
    s = list(str(input()))
    s.sort()
    S[i] = "".join(s)

c = collections.Counter(S)
cnt = 0
r = 2

for n in c.values():
    if n >= 2:
        cnt += factorial(n) / factorial(r) / factorial(n - r)
print(int(cnt))


### FIXED CODE ###

import collections
from math import factorial

N = int(input())
S = [0]*N
for i in range(N):
    s = list(str(input()))
    s.sort()
    S[i] = "".join(s)

c = collections.Counter(S)
cnt = 0
r = 2

for n in c.values():
    if n >= 2:
        a = factorial(n)
        b = factorial(r)*factorial(n - r)
        cnt += a/b
print(int(cnt))
a = input()
if(a%2 == 1):
  print((a+1)//2)
if(a%2 == 0):
  print(a//2)

### FIXED CODE ###

a = int(input())
if(a%2 == 1):
  print((a+1)//2)
if(a%2 == 0):
  print(a//2)
a =0
while True:
    n =int(input())
    i=i+1
    if n==0:
        break
    else:
        print("Case" + str(i)+": "+str(n))
        


### FIXED CODE ###

l = []
while True:
  i = str(input())
  if i == '0':
    break
  else:
    l.append(i)
t = 0
for i in l:
  t += 1
  print('Case '+str(t)+': '+i)
N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        temp = []
        if n % i == 0:
            temp.append(i)
            if i != n // i:
                temp.append(n//i)
                divisors.append(temp)

    # divisors.sort()
    return divisors

X = make_divisors(N)

for i in X:
    ans = min(10, max(len(str(i[0])), len(str(i[1]))))

print(ans)

### FIXED CODE ###

N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        temp = []
        if n % i == 0:
            temp.append(i)
            temp.append(n//i)
            divisors.append(temp)

    # divisors.sort()
    return divisors

X = make_divisors(N)
ans = 10

for i in X:
    ans = min(ans, max(len(str(i[0])), len(str(i[1]))))

print(ans)
import sys
sys.setrecursionlimit(10**7)
n=int(input())
l=[list(input()) for i in range(n)]
colors = [0 for i in range(n)]
es=[[] for i in range(n)]
for i in range(n):
  for j in range(n):
    if l[i][j]=='1':
      es[i].append(j)
def dfs(v,color):
    colors[v] = color
    for to in es[v]:
        if colors[to] == color:
            return False
        if colors[to] == 0 and not dfs(to, -color):
            return False
    return True

def is_bipartite():
    return dfs(0,1)
if is_bipartite()==0:
  print(-1)
  sys.exit()

for i in range(len(es)):
  if len(es[i])==1:
    x=i
connection=es
distance1=[-1 for i in range(n)]
distance1[x]=0
next=connection[x]
next2=[]
check=[-1 for i in range(n)]
check[x]=1
checkct=1
ct=0
while len(next)!=0 and checkct!=n:
  ct+=1
  for i in range(len(next)):
    distance1[next[i]]=ct
    check[next[i]]=1
    checkct+=1
    for j in range(len(connection[next[i]])):
      if check[connection[next[i]][j]]==-1:
        next2.append(connection[next[i]][j])
  next=next2
  next2=[]

print(max(distance1)+1)

### FIXED CODE ###

import sys
from collections import deque
sys.setrecursionlimit(10**7)
n=int(input())
l=[list(input()) for i in range(n)]
colors = [0 for i in range(n)]
es=[[] for i in range(n)]
Edges=es
for i in range(n):
  for j in range(n):
    if l[i][j]=='1':
      es[i].append(j)
def dfs(v,color):
    colors[v] = color
    for to in es[v]:
        if colors[to] == color:
            return False
        if colors[to] == 0 and not dfs(to, -color):
            return False
    return True
 
def is_bipartite():
    return dfs(0,1)
if is_bipartite()==0:
  print(-1)
  sys.exit()


def bfs(v):
    Visited=[False]*n
    q=deque()
    q.append((v,0))
    Visited[v]=True
    ret=(v,0)
    while q:
        fr,dist=q.popleft()
        if ret[1]<dist:
            ret=(fr,dist)
        for to in Edges[fr]:
            if not Visited[to]:
                Visited[to]=True
                q.append((to,dist+1))
    return ret

ans=[]
for i in range(n):
  ans.append(bfs(i)[1])
print(max(ans)+1)
from math import gcd

X,Y = [int(i) for i in input().split()]

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

i = 2
while True:
    if (X * i) % Y != 0:
        print(X*i)
        break
    elif (X * i) >= lcm(X,Y):
        print(-1)
        break
    else:
        i += 1

### FIXED CODE ###

[print(x*(y-1)if x%y else-1)for x,y in[[int(i)for i in input().split()]]]
n,x,t=map(int(input().split()))
count=0
if(n<=x):
  print(t,end='\n')
else:
  while(x>=n):
    count=count+1
    x=x+x
print((count+1)*t)

### FIXED CODE ###

n,x,t=map(int,input().split())
count=0
a=0
a=x
if(n<=x):
        print(t,end='\n')
        
elif(x==1):
        print((n)*t)
else:    
    while(x<n):
        count=count+1
        x=x+a    
    print((count+1)*t)
N = int(input())
S = str(N)
def f(s, p, x):
    if len(s) == 0:
        return 1 if x == 7 else 0
    if p:
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + f(s[1:], True, x | 4) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '8' or s[0] == '9':
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + f(s[1:], True, x | 4) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '7':
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + f(s[1:], False, x | 4) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '6':
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '5':
        return f(s[1:], True, x | 1) + f(s[1:], False, x | 2) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '4':
        return f(s[1:], True, x | 1) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '3':
        return f(s[1:], False, x | 1) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '2' or s[1] == '1':
        return (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '0':
        return 0
ans = f(S, False, 0)
print(ans)


### FIXED CODE ###

N = int(input())
S = str(N)
def f(s, p, x):
    if len(s) == 0:
        return 1 if x == 7 else 0
    if p:
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + f(s[1:], True, x | 4) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '8' or s[0] == '9':
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + f(s[1:], True, x | 4) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '7':
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + f(s[1:], False, x | 4) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '6':
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '5':
        return f(s[1:], True, x | 1) + f(s[1:], False, x | 2) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '4':
        return f(s[1:], True, x | 1) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '3':
        return f(s[1:], False, x | 1) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '2' or s[0] == '1':
        return (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '0':
        return 0
ans = f(S, False, 0)
print(ans)
import sys
from itertools import count, accumulate
from operator import mul
from functools import reduce
lines = sys.stdin.readlines()

positions = [int(i) for i in lines[1].split(' ')]

distances = [ j - i for i, j in zip(positions, positions[1:])]

n = len(distances)
factorials = [1] + list(accumulate(range(1,n + 1), mul))

combinations = dict()
def combination(i, j):
    if (i, j) in combinations:
        return combinations((i, j))
    else:
        return factorials[i] / (factorials [j] * factorials[i - j])

permutations = dict()
def permutation(i, j):
    if (i, j) in permutations:
        return permutations((i, j))
    else:
        return reduce(mul, range(j, i+1))

s = 0
result = 0
for d, i in zip(distances, count(1)):
    lt = i - 1
    gt = n - i
    t = factorials[lt] * combination(n, gt) * factorials[gt]
    s += t
    result += d * s

print(int(result % (pow(10,9) + 7)))

### FIXED CODE ###

import sys
from itertools import count, accumulate
from operator import mul
from functools import reduce
lines = sys.stdin.readlines()

positions = [int(i) for i in lines[1].split(' ')]

distances = [ j - i for i, j in zip(positions, positions[1:])]

n = len(distances)
p = pow(10,9) + 7

factorials = [1] + list(accumulate(range(1,n + 1), lambda x, y: (x * y) % p))

combinations = dict()
def combination(i, j):
    j = min(j, i - j)
    if (i, j) in combinations:
        return combinations((i, j))
    else:
        return factorials[i] // (factorials [j] * factorials[i - j])

permutations = dict()
def permutation(i, j):
    if (i, j) in permutations:
        return permutations((i, j))
    else:
        return reduce(mul, range(j, i+1))

def modpow(a, n, mod):
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n = n >> 1
    return res

s = 0
result = 0
for d, i in zip(distances, count(1)):
    lt = i - 1
    gt = n - i
    i_inv = modpow(i, p-2, p)
    t = factorials[n] * i_inv
    s += t
    result += d * s

print(int(result % (pow(10,9) + 7)))
l_1 = [1,3,5,7,8,10,12]
l_2 = [4,6,9,11]
l_3 = [2]

x,y = map(list(int,input()).split())

if x == 2:
    if y == 2:
        print("yes")
    else:
        print("no")
elif x in l_1:
    if y in x_1:
        print("yes")
    else:
        print("no")
else x in l_2:
    if y in l_2:
        print("yes")
    else:
        print("no")

### FIXED CODE ###

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

a = [0,1,3,1,2,1,2,1,1,2,1,2,1]

if a[x] == a[y]:
    print("Yes")
else:
    print("No")
#26　AtCoder Beginner Contest 138 D - Ki
n, q = map(int, input().split())
edge = [[] for _ in range(n)]
counter = [[] for _ in range(n)]
ans_list = [0]*n

def dfs(start, count):
    ans_list[start] += count
    for c in edge[start]:
        dfs(c, count)

for _ in range(n-1):
    u, v = map(int, input().split())
    edge[u-1].append(v-1)
for _ in range(q):
    u, v = map(int, input().split())
    dfs(u-1, v)
print(*ans_list)

### FIXED CODE ###

from collections import deque
n, q = map(int, input().split())
g = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)
count = [0]*n
for i in range(q):
    p, x = map(int, input().split())
    count[p-1] += x
q = deque([0])
d = [0]*n
while q:
    v = q.popleft()
    d[v] = 1
    for i in g[v]:
        if d[i]:
            continue
        count[i] += count[v]
        q.append(i)
print(*count)
H,W = list(map(int, input().split()))
S = [[1 if s=='.' else 0 for s in input()] for _ in range(H)] #S[h][w]

import numpy as np
S = np.array(S)
#print(S)

SH = np.zeros((H,W), dtype='int')
SH_ = np.zeros((H,W), dtype='int')

SV = np.zeros((H,W), dtype='int')
SV_ = np.zeros((H,W), dtype='int')

#horizontal
for h in range(H):
  SH[h][0] = S[h][0]
  for w in range(1,W):
    if S[h][w]:
      SH[h][w] = SH[h][w-1] + 1
  
  SH_[h][-1] = S[h][-1]
  for w in range(W-1)[::-1]:
    if S[h][w]:
      SH_[h][w] = SH_[h][w+1] + 1
  

#vertical
for w in range(W):
  SV[0][w] = S[0][w]
  for h in range(1,H):
    if S[h][w]:
      SV[h][w] = SV[h-1][w] + 1
  
  SV_[-1][w] = S[-1][w]
  for h in range(H-1)[::-1]:
    if S[h][w]:
      SV_[h][w] = SV_[h+1][w] + 1

#print(SH + SH_)
#print(SV + SV_)

print(np.max(SH+SH_+SV+SV_) -3)


### FIXED CODE ###

P,Q,R = list(map(int, input().split()))
print(min([P+Q,Q+R,R+P]))
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import math
a, b, c = map(int, input().split())
flag = 0
if a**(1 / 2) + b**(1 / 2) < c**(1 / 2):
    flag = 1
elif a**(1 / 2) + b**(1 / 2) > c**(1 / 2)
    flag = 0
else:
    flag = 1
    

if flag == 1:
    print("Yes")
else:
    print("No") 

### FIXED CODE ###

#!/usr/bin/python3
# -*- coding: utf-8 -*-
import math
a, b, c = map(int, input().split())
if 0 < (c - a - b) and 4 * a * b < (c - a - b)**2:
    print("Yes")
else:
    print("No")
n=int(input())
a=[1 for i in list(map(int,input().split())) if i%4==0]
print("Yes" if len(a)>=n//2 "No")

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=[1 for i in a if i%4==0]
c=[1 for i in a if i%4!=0 and i%2==0]
print("Yes" if len(b)+len(c)//2>=n//2 else "No")
n = list(input())
n_size = len(n)
count = 0
#print(n_size)  
new_list = []
new_list.append(int(n[0]))
for i in range(n_size-1):
  if new_list[i] == 0:
    new_list.append(1)
  else:
    new_list.append(0)

#print(new_list)
    
for i in range(n_size):
  if (int(n[i]) != int(new_list[i])):
    count+=1

#print(new_list)    
if n_size == 1:
  print(0)
else:
#  ans = n_size-count    
  print(count)    
    


### FIXED CODE ###

n = input().split()
count = 0
if int(n[0]) > int(n[1]):
  count +=int(n[0])
  if int(n[0])-1 > int(n[1]):
    count +=int(n[0])-1
  else:
    count +=int(n[1])
else:
  count +=int(n[1])
  if int(n[1])-1 > int(n[0]):
	  count +=int(n[1])-1
  else:
	  count +=int(n[0])

print(count)
x = int(input())
x = i
if x>90:
    x = x-90
ans = 0
a = 360
while True:
    if a%x==0:
        ans+=a//x
        break
    else:
        rem = a%x
        ans+=a//x
        a-=rem
print(ans)


### FIXED CODE ###

x = int(input())
ans = 0
for i in range(1,361):
    num = 360*i
    if num%x==0:
        print(num//x)
        exit()
n = int(input())
s = tuple(map(int, input()))
f = [
    [] for i in range(n+1)
]
ans = 0

for i in range(n-2):
    if len(f[s[i]]) != 0:
        continue
    else:
        for j in range(i+1, n-1):
            if s[j] in f[s[i]]:
                continue
            else:
                f[s[i]].append(s[j])
                a = tuple(set(s[j+1:]))
                ans += len(a)

print(ans)


### FIXED CODE ###

n = int(input())
s = tuple(map(int, input()))
f = [
    [] for i in range(10)
]
ans = 0

for i in range(n-2):
    if len(f[s[i]]) != 0:
        continue
    else:
        for j in range(i+1, n-1):
            if s[j] in f[s[i]]:
                continue
            else:
                f[s[i]].append(s[j])
                a = tuple(set(s[j+1:]))
                ans += len(a)

print(ans)
n = int(input)
a = int(input)
print("Yes") if ((n % 500) <= a) else print("No")

### FIXED CODE ###

n = int(input())
a = int(input())
print("Yes") if n % 500 <= a else print("No")
N = int(input())
A = list(map(int,input().split()))

isBigger = A[0] < A[1] 
isEqual = A[0] == A[1]
ans = 0
for i in range(1,N):
    if isEqual:
        if A[i] < A[i-1]:
            isBigger = False
            isEqual = False
        elif A[i-1] < A[i]:
            isBigger = True
            isEqual = False
        else:
            continue
    elif isBigger:
        if A[i] < A[i-1]:
            ans += 1
            if i < N-1:
                isBigger = A[i] < A[i+1]
                isEqual = A[i] == A[i+1]
            else:
                break
    else:
        if A[i-1] < A[i]:
            ans += 1
            if i < N-1:
                isBigger = A[i] < A[i+1]
                isEqual = A[i] == A[i+1]
            else:
                break

ans += 1
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))

ans = 0
if 2 <= N:
    isBigger = A[0] < A[1] 
    isEqual = A[0] == A[1]
    for i in range(1,N):
        if isEqual:
            if A[i] < A[i-1]:
                isBigger = False
                isEqual = False
            elif A[i-1] < A[i]:
                isBigger = True
                isEqual = False
            else:
                continue
        elif isBigger:
            if A[i] < A[i-1]:
                ans += 1
                if i < N-1:
                    isBigger = A[i] < A[i+1]
                    isEqual = A[i] == A[i+1]
                else:
                    break
        else:
            if A[i-1] < A[i]:
                ans += 1
                if i < N-1:
                    isBigger = A[i] < A[i+1]
                    isEqual = A[i] == A[i+1]
                else:
                    break

ans += 1
print(ans)
n,k = map(int, input().split())
cnt=0
while n!=0:
    n=n//k
    cnt+=1
print(cnt)





### FIXED CODE ###

n,r=map(int,input().split())
if n>=10:
    print(r)
else:
    print(r+100*(10-n))