Harryxun/stf_run huggingface dataset:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

minutes = 0
items = [A, B, C, D, E]
rems = [item % 10 for item in items if item % 10 != 0]
cnt = len(rems)
minutes += min(rems)

for item in items:
    minutes += (item//10)*10
 
if cnt > 0:
    minutes += (cnt-1)*10

print(minutes)

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

minutes = 0
items = [A, B, C, D, E]
rems = [item % 10 for item in items if item % 10 != 0]
cnt = len(rems)


for item in items:
    minutes += (item//10)*10
 
if cnt > 0:
    minutes += (cnt-1)*10
    minutes += min(rems)

print(minutes)
n, k = [int(j) for j in input().split(' ')]
p = input().split(' ')
 
p.sort()
sum = 0
 
for i in range(0,k):
  sum+=int(p[i])
  
return sum

### FIXED CODE ###

n, k = [int(j) for j in input().split(' ')]
p = [int(j) for j in input().split(' ')]
 
p.sort()
sum = 0
 
for i in range(0,k):
  sum+=p[i]
  
print(sum)
import itertools

def getint(): return int(input())
def getints(): return list(map(int, input().split()))

n=getint()
a=getints()
inf = 1 << 60

cache=[[-inf] * 2 for _ in range(n)]

def solve(pos, minus):
    if pos == n - 1:
        return -a[pos] if minus else a[pos]
    res = cache[pos][minus]
    if res > -inf:
        return res
    now = a[pos] if minus == 0 else -a[pos]
    res1 =  now + solve(pos + 1, 0)
    res2 = -now + solve(pos + 1, 1)
    res  = max(res1, res2)
    cache[pos][minus] = res
    return res

res = solve(0, 0)
print(res)

### FIXED CODE ###

import itertools

def getint(): return int(input())
def getints(): return list(map(int, input().split()))

n=getint()
a=getints()
inf = 1 << 60

cache=[[-inf] * 2 for _ in range(n)]

def solve(pos, minus):
    if pos == n - 1:
        return -a[pos] if minus else a[pos]
    res = cache[pos][minus]
    if res > -inf:
        return res
    now = a[pos] if minus == 0 else -a[pos]
    res1 =  now + solve(pos + 1, 0)
    res2 = -now + solve(pos + 1, 1)
    res  = max(res1, res2)
    cache[pos][minus] = res
    return res

for i in range(n-1,-1,-1):
    solve(i, 0)
    solve(i, 1)

res = solve(0, 0)
print(res)
InData=input().split
Indata = map(int, InData)
sorted = sort(InData)
print(' '.join(map(str, sorted)))


### FIXED CODE ###

InData=input().split()
InDataM = [int(i) for i in InData]
result = sorted(InDataM)
print(' '.join(map(str, result)))
from decimal import *

a = list(input().rstrip().split(" "))

A,B =Decimal(int(a[0])),float(a[1])

if A > 1**6:
    C = int(B*100)
    ans1 = int(100*B)
    ans2 = (A-100)*C
    ans3 = int(ans2/100)
    ans = ans1 + ans3
else:
    ans = int(A*B)
    
print(ans)

### FIXED CODE ###

a, b = map(float, input().split())
a = int(a)
b = int(b * 1000)
print((a*b)//1000)
n, k = map(int, input().split())
a = list(map(int, input().split()))

if all(i<=0 for i in a) or n==k:
    a.sort(reverse=True)
    res = 1
    mod = 10**9 + 7
    for i in range(k):
        res = (res*a[i])%mod
    print(res)
else:
    mainas = []
    plus = []
    for i in range(n):
        if a[i] < 0: mainas.append(a[i])
        else: plus.append(a[i])
        
    mainas.sort()
    mainas.extend([0,0,0,0])
    plus.extend([0,0,0,0])
    plus.sort(reverse=True)

    m, p = 0,0
    r = []
    while k > 1:
        if mainas[p]*mainas[p+1] < plus[m]*plus[m+1]:
            r.extend(plus[m:m+2])
            m += 2
        else:
            r.extend(mainas[p:p+2])
            p += 2
        k -= 2

    if k == 1:
        r.append(plus[m])

    res = 1
    mod = 10**9 + 7
    for i in r:
        res = (res*i)%mod
    print(res)

### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10**9 + 7
res = 1
a.sort(reverse=True)
if a[0]<0 and k%2==1:
    for i in range(k):
        res = (res*a[i])%mod
else:
    right = n-1
    left = 0
    while k > 1:
        if a[right]*a[right-1] < a[left]*a[left+1]:
            res = (res*a[left])%mod
            left += 1
            k -= 1
        else:
            res = (res*a[right]*a[right-1])%mod
            right -= 2
            k -= 2
    if k == 1:
        res = (res*a[left])%mod

print(res)
N, M = map(int, input().split())
S, C = [], []
for _ in range(M):
    s, c = map(int, input().split())
    s -= 1
    if s in S:
        if C[S.index(s)] != c:
            print(-1)
            exit()
        else:
            continue
    S.append(s)
    C.append(c)

z = zip(S, C)
z = sorted(z)
S, C = zip(*z)

ans = [-1] * N
for i in range(len(S)):
    ans[S[i]] = C[i]

if ans[0] == 0:
    print(-1)
    exit()

while len(ans) > 0:
    if ans[0] == -1:
        ans = ans[1:]
    else:
        break

if ans == [-1]:
    print(-1)
    exit()

ans = [a if a != -1 else 0 for a in ans]
print(''.join(list(map(str, ans))))

### FIXED CODE ###

N, M = map(int, input().split())
S, C = [], []
for _ in range(M):
    s, c = map(int, input().split())
    s -= 1
    if s in S:
        if C[S.index(s)] != c:
            print(-1)
            exit()
        else:
            continue
    S.append(s)
    C.append(c)

if len(S) == 0:
    if N == 1:
        print(0)
    elif N == 2:
        print(10)
    else:
        print(100)
    exit()

ans = [-1] * N
for i in range(len(S)):
    ans[S[i]] = C[i]

if N == 1:
    if ans[0] == 0:
        print(0)
        exit()

if ans[0] == -1:
    ans[0] = 1
elif ans[0] == 0:
    print(-1)
    exit()

ans = [a if a != -1 else 0 for a in ans]
print(''.join(list(map(str, ans))))
n = int(input())
s = input()
ans = s[1]
for i in range(1, n):
    if ans[-1] == s[i]:
        continue
    else:
        ans += s[i]
print(len(ans))

### FIXED CODE ###

n = int(input())
s = input()
ans = s[0]
for i in range(1, n):
    if ans[-1] == s[i]:
        continue
    else:
        ans += s[i]
print(len(ans))
count=0 
res=0 
for ch in inp: 
  if ch=="R": 
    count+=1 
    res = max(res,count) 
  else: 
    res=max(res,count) 
    count=0 
print(res)

### FIXED CODE ###

inp =input()
count=0 
res=0 
for ch in inp: 
  if ch=="R": 
    count+=1 
    res = max(res,count) 
  else: 
    res=max(res,count) 
    count=0 
print(res)
X = int(input())
import sys
for a in range(-118, 120, 1):
    for b in range(-119, 119, 1):
        if x == pow(a,5) - pow(b,5):
            print(x)
            sys.exit()

### FIXED CODE ###

X = int(input())
import sys
for a in range(-118, 120, 1):
    for b in range(-119, 119, 1):
        if X == pow(a,5) - pow(b,5):
            print(a, b)
            sys.exit()
import math
a, b, x =map(int, input().split())
if x >= a*a*b/2:
   print( math.degrees(math.tanh(2/a*(b-x/(a*a))))
else:
   print(math.degrees(math.tanh(a*b*b/(2*x))))

### FIXED CODE ###

import math
a, b, x = map(int, input().split())
if x >= a*a*b/2:
   print(math.degrees(math.atan(2/a*(b-x/(a*a)))))
else:
   print(math.degrees(math.atan((a*b*b)/(2*x))))
i = 0
total = 0
while i < len(S):
    if S[i:i+2] == '01'or S[i:i+2] == '10':
        Sa = S[:i]
        Sb = S[i+2:]
        S = Sa+Sb
        total += 1
        i -= 1
    else:
        i += 1
print(total*2)

### FIXED CODE ###

S = input()
i = 0
total = 0
while i < len(S):
    if S[i:i+2] == '01'or S[i:i+2] == '10':
        Sa = S[:i]
        Sb = S[i+2:]
        S = Sa+Sb
        total += 1
        i -= 1
    else:
        i += 1
print(total*2)
import sys, copy, math, heapq, bisect
from itertools import accumulate
from collections import deque, defaultdict, Counter
input = sys.stdin.readline # 文字列の入力のとき'/n'まで受け取るので注意!!!
sys.setrecursionlimit(500000)

N = int(input())
T = [defaultdict(int) for i in range(N)]
for i in range(N-1):
    u,v,w = map(int,input().split())
    T[u-1][v-1] = w
    T[v-1][u-1] = w
visited = [0]*N
ans = [0]*N
def dfs(now,col):
    visited[now] = 1
    for i in T[now].keys():
        if visited[i] == 1:
            continue
        if T[now][i]%2==1:
            ans[i] = col^1
            next =  = col^1
        else:
            ans[i] = col
        dfs(i,next)
dfs(0,0)
for i in range(N):
    print(ans[i])



### FIXED CODE ###

import sys, copy, math, heapq, bisect
from itertools import accumulate
from collections import deque, defaultdict, Counter
input = sys.stdin.readline # 文字列の入力のとき'/n'まで受け取るので注意!!!
sys.setrecursionlimit(500000)

N = int(input())
T = [defaultdict(int) for i in range(N)]
for i in range(N-1):
    u,v,w = map(int,input().split())
    T[u-1][v-1] = w
    T[v-1][u-1] = w
visited = [0]*N
ans = [0]*N
def dfs(now,col):
    visited[now] = 1
    for i in T[now].keys():
        if visited[i] == 1:
            continue
        if T[now][i]%2==1:
            ans[i] = col^1
            next = col^1
        else:
            ans[i] = col
            next = col
        dfs(i,next)
dfs(0,0)
for i in range(N):
    print(ans[i])
n, l = map(int, input().split())
strs = []

for i in range(l):
    strs.append(input())

strs.sort()
print(''.join(strs))

### FIXED CODE ###

n, l = map(int, input().split())
strs = []

for i in range(n):
    strs.append(input())

strs.sort()
print(''.join(strs))
n = int(input())
spi = []
for i in range(n):
    s, p = map(input().split())
    spi.append((s,-int(p), i))
spi = sorted(spi)
for s, p, i in spi:
    print(i+1)

### FIXED CODE ###

n = int(input())
spi = []
for i in range(n):
    s, p = input().split()
    spi.append((s,-int(p), i))
spi = sorted(spi)
for s, p, i in spi:
    print(i+1)
import math

a, b = map(int, input().split())
print(math.floor(a*b))


### FIXED CODE ###

def main():
    A, B = input().split()
    A = int(A)
    B_big, B_small = B.split(".")
    B_big = int(B_big)
    B_small = int(B_small)
    print(A*B_big + A*B_small//100)
 
 
if __name__ == "__main__":
    main()
N,C=map(int, input().split())
inarr=[[int(i) for i in input().split()] for _ in range(N)]
maxes=[(0, 0)]*N
cums=[0]*(N+1)
cum = 0
cummax = (0, 0)
for i, [a, v] in enumerate(inarr):
    cum += v
    if (cum - a) > cummax[0]:
        cummax = (cum - a, a)
    maxes[i]=cummax
    cums[i+1]=cum

print("cummax: {}, cums: {}".format(cummax, cums))
if cummax[0] == 0:
    print(0)
    exit(1)

resmax = 0
for i, [b, v] in enumerate(inarr):
    oasum, x = (0, 0) if i == 0 else maxes[i-1]
    obsum = cums[N] - cums[i] - (C-b)
    print("len oa: {} len ob: {} oa sum: {} ob sum: {} score: {}".format(x, C-b, oasum, obsum, obsum + oasum - min(C-b, x)))
    resmax = max(resmax, obsum + oasum - min(C-b, x))
    # print(resmax)

print(maxes[N-1])
resmax = max(resmax, maxes[N-1][0])
print(resmax)


### FIXED CODE ###

N,C=map(int, input().split())
inarr=[[int(i) for i in input().split()] for _ in range(N)]
maxes1=[(0, 0)]*N
maxes2=[(0, 0)]*N
cums=[0]*(N+1)
cum = 0
cummax1 = (0, 0)
cummax2 = (0, 0)
for i, [a, v] in enumerate(inarr):
    cum += v
    if (cum - a) > cummax1[0]:
        cummax1 = (cum - a, a)
    if (cum - 2*a) > cummax2[0]:
        cummax2 = (cum - 2*a, a)
    maxes1[i]=cummax1
    maxes2[i]=cummax2
    cums[i+1]=cum

# print("{}".format(maxes1))
resmax = 0
for i, [b, v] in enumerate(inarr):
    oasum1, x = (0, 0) if i == 0 else maxes1[i-1]
    oasum2, x = (0, 0) if i == 0 else maxes2[i-1]
    obsum = cums[N] - cums[i]
    resmax = max(resmax, obsum + oasum1 - 2*(C-b), obsum + oasum2 - (C-b))
    # print(resmax)

# print(maxes1[N-1])
print(max(resmax, maxes1[N-1][0], 0))
n=it(input())
ans=0
for i in range(1,n):
  ans+=int((n-1)/i)
print(ans)

### FIXED CODE ###

n=int(input())
ans=0
for i in range(1,n):
  ans+=int((n-1)/i)
print(ans)
voca = input()

output = vaca[0] + str(len(vaca) - 2) + vaca[-1]

print(output)

### FIXED CODE ###

voca = input()

a = len(voca) - 2

output = voca[0] + str(a) + voca[-1]
 
print(output)
s=input()
result=0
for i in s:
  result+=1 if i=="+" else result-=1
print(result)

### FIXED CODE ###

s=input()
result=0
for i in s:
    if i=="+" : result+=1
    else : result-=1
print(result)
n,k  = map(int,input().split())
h = list(map(int,input().split()))
dp = [0] * n
dp[0] = 0 # 最初のdpのコストを0にする

# dp(0)~dp(i)（dp(i)+hm-hi以外）の値を求める
for i in range (1, k):
    dp[i] = abs(h[i] - h[0])

# dp(i)+hm-hiの値を求める    
for i in range(1, n):
    dp[i] = min(dp[j] + abs(h[j] - h[i]) for j in range(max(0, i-k), i))
print(dp[-1])

### FIXED CODE ###

n,k  = map(int,input().split())
h = list(map(int,input().split()))
dp = [0] * n
dp[0] = 0 # 最初のdpのコストを0にする
  
for i in range(1, n):
    dp[i] = min(dp[j] + abs(h[j] - h[i]) for j in range(max(0, i-k), i))
print(dp[-1])
n=int(input())
l=list(map(int,input().split()))

ans=0
for i in range(n):
  for j in range(n):
    for k in range(n):
      if i <= j <= k:
        if l[i]==l[j] or  l[j]==l[k] or l[i]==l[k]:
          continue
        if max(l[i],l[j],l[k]) < sum(sum(l[i],l[j]),l[k]) - max(l[i],l[j],l[k]):
          ans+=1
print(ans)

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))

ans=0
for i in range(n):
  for j in range(n):
    for k in range(n):
      if i <= j <= k:
        if l[i]==l[j] or  l[j]==l[k] or l[i]==l[k]:
          continue
        if max(l[i],l[j],l[k]) < l[i] +l[j] + l[k] - max(l[i],l[j],l[k]):
          ans+=1
print(ans)
def lp(node,memo,graph):
    if memo[node] != -1:
        return memo[node]
    cand = [0]
    if graph[node]:
        for neighbor in graph[node]:
            cand.append(lp(neighbor,memo,graph))
        maximam = max(cand)+1
    else:
        maximam = 0
    memo[node]=maximam
    return maximam

N,M = map(int, input().split())
graph = {}
for i in range(N+1):
    graph[i] = []
for _ in range(M):
    x,y = map(int,input().split())
    graph[x].append(y)
ans = 0
memo = [-1]*(N+1)
for i in range(1,N+1):
    ans = max(ans, lp(i,memo,graph))
print(ans)

### FIXED CODE ###

def lp(node,memo,graph):
    if memo[node] != -1:
        return memo[node]
    cand = [0]
    if graph[node]:
        for neighbor in graph[node]:
            cand.append(lp(neighbor,memo,graph))
        maximam = max(cand)+1
    else:
        maximam = 0
    memo[node]=maximam
    return maximam

import sys
sys.setrecursionlimit(10**5)
N,M = map(int, input().split())
graph = {}
for i in range(N+1):
    graph[i] = []
for _ in range(M):
    x,y = map(int,input().split())
    graph[x].append(y)
ans = 0
memo = [-1]*(N+1)
for i in range(1,N+1):
    ans = max(ans, lp(i,memo,graph))
print(ans)
import math
r = float(input())

s = r * r * math.pi
l = r * 2 * math.pi

print("{0:.5f} {1:.5f}"format(s, l))

### FIXED CODE ###

import math
r = float(input())

s = r * r * math.pi
l = r * 2 * math.pi

print("{0:.5f} {1:.5f}".format(s, l))
from sys import stdin
from collections import defaultdict

def main():
    n = int(stdin.readline().rstrip())
    D = [int(i) for i in input().split()]
    hash = defaultdict(int)
    for i in D:
        hash[i] += 1
    count = hash[0]
    for i in range(1, n):
        count *= hash[i-1] ** hash[i]
    print(count/998244353)
    
if __name__ == '__main__':
    main()


### FIXED CODE ###

from sys import stdin
import collections
def main():
    n = int(stdin.readline().rstrip())
    D = [int(i) for i in input().split()]
    hash = collections.Counter(D)
    count = hash[0]
    if(count != 1 or D[0] != 0):
        print(0)
        return
    for i in range(1, max(D)+1):
        count *= hash[i-1] ** hash[i]
    print(count%998244353)
    
if __name__ == '__main__':
    main()
while True:
    if len(SA)==0:
        print('A')
        break
    elif len(SB)==0:
        print('B')
        break
    elif len(SC)==0:
        print('C')
        break

    if card == 'a':
        SA = SA[1:]
        card = SA[0]
    elif card == 'b':
        SB = SB[1:]
        card = SB[0]
    elif card == 'c':
        SC =SC[1:]
        card = SC[0]

### FIXED CODE ###

SA, SB, SC = [input() for i in range(3)]
SA = SA + '0'
SB = SB + '0'
SC = SC + '0'

card = SA[0]
SA = SA[1:]

for i in range(303):
    if SA == '0' and card == 'a':
        print('A')
        break
    elif SB == '0' and card == 'b':
        print('B')
        break
    elif SC == '0' and card == 'c':
        print('C')
        break
    
    if card == 'a':
        card = SA[0]
        SA = SA[1:]
    elif card == 'b':
        card = SB[0]
        SB = SB[1:]
    elif card == 'c':
        card = SC[0]
        SC = SC[1:]
#AtCoder
from math import sqrt
N = int(input())
lst = [list(map(int, input().split())) for _ in range(N)]
res = 0
for i in range(N):
    for j in range(N):
        if i != j:
            res += sqrt((lst[i][0] - lst[j][0])**2 + (lst[i][1] - lst[j][1])**2) 
print(res/N)

### FIXED CODE ###

#AtCoder
r = int(input())
ar = r*r
print(int(ar/1))
n = int(input())
A = list(map(int, input().split()))
q = int(input())

total = sum(A)
dic = {}
for i in range(q):
  b, c = map(int, input().split())
  b_count = A.count(b)
  c_count = A.count(c)
  dic[c] = c_count + b_count
  if b in dic:
    b_count = dic[b]
  diff = c - b
  total += b_count*diff
  print(total)
  
  
    

### FIXED CODE ###

alpha = str(input())

if  (alpha.islower() == True):
  print('a')
else:
  print('A')
,b=list(map(int,input().split()))
s=a-2*b
if s<=0:
    print(0)
else:
    print(s)



### FIXED CODE ###

a,b=list(map(int,input().split()))
s=a-2*b
if s<=0:
    print(0)
else:
    print(s)
def gcd(a,b):
  a,b=max(a,b),min(a,b)
  if b==0:
    return a
  else:
    return gcd(b,a%b)
 
n=int(input())
arr=list(map(int,input()))
tmp=gcd(arr[0],arr[1])
for i in range(1,n):
  tmp=gcd(tmp,arr[i])
print(tmp)

### FIXED CODE ###

def gcd(a,b):
  a,b=max(a,b),min(a,b)
  if b==0:
    return a
  else:
    return gcd(b,a%b)
 
n=int(input())
arr=list(map(int,input().split()))
tmp=gcd(arr[0],arr[1])
for i in range(1,n):
  tmp=gcd(tmp,arr[i])
print(tmp)
import math
n = int(input())
print(( 2 * n ) // math.gcd(2, n))

### FIXED CODE ###

n = int(input())
if n % 2 == 0:
    print(n)
else:
    print(n * 2)
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
l = [0,0]
count = 0
for j in range(len(a)-1):
    if(count => 2):
        print(l[0] * l[1])
        break
    if(a[j] == a[j+1]):
        del l[0]
        l.append(a[j])
        j += 1
        count += 1

### FIXED CODE ###

n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
l = [0,0]
c = 0
i = 0
while(i < len(a)-1):
    if(a[i] == a[i+1]):
        del l[0]
        l.append(a[i])
        i += 1
        c += 1
    if(c >= 2 or i == len(a)-2):
        i = len(a)-1
        print(l[0] * l[1])
    i += 1
cards = []
for suit in ('S','H','C','D'):
    for num in range(1,14):
        cards.append(suit+' '+str(num))

while 1;
    if raw_input() in cards:
        cards.remove(raw_input())


for card in cards:
    print card

### FIXED CODE ###

cards = []
for suit in ('S','H','C','D'):
    for num in range(1,14):
        cards.append(suit+' '+str(num))

N = int(raw_input())

for n in xrange(N):
    suit, number = raw_input().split()
    cards.remove(suit+' '+number)


for card in cards:
    print card
a=int(input())
b=int(input())
if a==b:
  print(1)
  exit()
abin=bin(a)[2:]
bbin=bin(b)[2:]
la=len(abin)
lb=len(bbin)
if la==lb:
  while abin[0]==bbin[0]:
    abin=abin[1:]
    bbin=bbin[1:]
  while abin[0]=="0":
    abin=abin[1:]
cbin=bbin[1:]
while cbin[0]=="0":
  cbin=cbin[1:]
c=2**(len(cbin))
a=int(abin,2)
lbnd=2**(lb-1)+c
hbnd=2**(lb-1)+a
if lbnd>=hbnd:
  print(lbnd-a+1)
else:
  print(2**(lb-1)-a+lbnd-a+1)

### FIXED CODE ###

a=int(input())
b=int(input())
if a==b:
  print(1)
  exit()
abin=bin(a)[2:]
bbin=bin(b)[2:]
la=len(abin)
lb=len(bbin)
if la==lb:
  while abin[0]==bbin[0]:
    abin=abin[1:]
    bbin=bbin[1:]
  while len(abin)>1 and abin[0]=="0":
    abin=abin[1:]
cbin=bbin[1:]
while cbin and cbin[0]=="0":
  cbin=cbin[1:]
c=2**(len(cbin))-1
a=int(abin,2)
b=int(bbin,2)
lb=len(bbin)
lbnd=2**(lb-1)+c
hbnd=2**(lb-1)+a
if lbnd>=hbnd:
  print(2**lb-a)
else:
  print(2**(lb-1)-a+lbnd-a+1)
N = input()
S= input()
hoge=[]
Alphas='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
 
for a in S:
  for i, Alpha in enumerate(Alphas):
    if Alpha == a:
      hoge.append(Alphas[(i+N)%26])
      break
mojiretsu=''
for x in hoge:
    mojiretsu += x
print(mojiretsu)

### FIXED CODE ###

N = int(input())
S = input()
hoge=[]
Alphas='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
 
for a in S:
  for i, Alpha in enumerate(Alphas):
    if Alpha == a:
      hoge.append(Alphas[(i+N)%26])
      break
mojiretsu=''
for x in hoge:
    mojiretsu += x
print(mojiretsu)
X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
eat_p = p[:X]
eat_q = q[:Y]

ans = sum(eat_p) + sum(eat_q)
if A == 1:
    i = 0
else:
    i = -1
if B == 1:
    j = 0
else:
    j = -1
k = 0

while True:
    if k == C or (eat_p[i] >= r[k] and eat_q[j] >= r[k]):
        break
    if eat_p[i] < eat_q[j] and eat_p[i] < r[k]:
        ans += r[k] - eat_p[i]
        k += 1
        i -= 1
    if eat_p[i] >= eat_q[j] and eat_q[j] < r[k]:
        ans += r[k] - eat_q[j]
        k += 1
        j -= 1
    if i == -A:
        i = 0
    if j == -B:
        j = 0

print(ans)


### FIXED CODE ###

X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort(reverse=True)
q.sort(reverse=True)
eat_p = p[:X]
eat_q = q[:Y]

all_apple = eat_p + eat_q + r
all_apple.sort(reverse=True)

print(sum(all_apple[:X+Y]))
import itertools

H,W = map(int,input().split())
S = [list(input()) for _ in range(H)]

VALID = [[False] * W for _ in range(H)]

def dfs(h,w,parent):
  if parent:
    VALID[h][w] = True

  nxt = [-1,0,1]
  ok = False
  for x,y in itertools.product(nxt,repeat=2):
    if not (abs(x) + abs(y) == 1):
      continue
    nx = h + x
    ny = w + y
    if 0 <= nx < H and 0 <= ny < W and S[nx][ny] == '#':
      ok = True
      dfs(nx,ny,True)
  
  if not parent and ok:
    VALID[h][w] = True
      
for i in range(H):
  for j in range(W):
    if S[i][j] == '.':
      VALID[i][j] = True
    else:
      if not VALID[i][j]:
        dfs(i,j,False)
        
if all(sum(VALID,[])):
  print('Yes')
else:
  print('No')


### FIXED CODE ###

import itertools

H,W = map(int,input().split())
S = [list(input()) for _ in range(H)]

ok = True        
for i in range(H):
  for j in range(W):
    if S[i][j] == '#':
      flg = False
      for x,y in itertools.product([-1,0,1],repeat=2):
        if not (abs(x) + abs(y) == 1):
          continue
        nx = i + x;ny = j + y
        if 0 <= nx < H and 0 <= ny < W:
          if S[nx][ny] == '#':
            flg = True
      if not flg:
        ok = False
        break
if ok:
  print('Yes')
else:
  print('No')