Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

def main():
  N,M = map(int,input().split())
  A = [int(input()) for _ in range(M)]
  
  dp = [0]*(N+1)
  dp[0] = 1
  if 1 in A:
    dp[1] = 0
  else:
    dp[1] = 1

  for i in range(2,N+1):
    if i not in A:
      dp[i] = (dp[i-1] + dp[i-2])%1000000007
    else:
      dp[i] = 0
  print(dp[N])

if __name__ == "__main__":
  main()

### FIXED CODE ###

mod = 10**9+7
n,m = map(int,input().split())
a = set()
for i in range(m):
  a.add(int(input()))
dp = [0]*(n+1)
dp[0] = 1
for i in range(1,n+1) :
    dp[i] = (dp[i-1] + dp[i-2]) % mod
    if i in a :
        dp[i] = 0
print(dp[n])
### BUGGY CODE ###

import math
import collections

N, M = input().strip().split(' ')
N, M = [int(N), int(M)]

#階乗
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

#素因数分解
def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors

C = collections.Counter(prime_factors(M))

res = 1
for c in C.items():
    #print(c[0], c[1])
    res *= combinations_count((c[1] + N - 1), c[1])

print(res % (1000000007))

### FIXED CODE ###

N, M = [int(_) for _ in input().split()]

mod = 10 ** 9 + 7
MAX_N = 10 ** 5 + 100

#階乗
def calc_factorial(max_i):
    factorial = [1] * max_i
    for i in range(1, max_i):
        factorial[i] = (i * factorial[i - 1]) % mod
    return factorial

#素因数分解
def calc_factorization(n):
    factorization = {}
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            factorization[i] = 1
            n = n // i
            while n % i == 0:
                factorization[i] += 1
                n = n // i
    if n > 1:
        factorization[n] = 1
    return factorization

#組み合わせ
def comb(factorial, n, k, mod):
    a = factorial[n] % mod
    b = (factorial[k] * factorial[n - k]) % mod
    b_ = pow(b, mod - 2, mod)
    return (a * b_) % mod

C = calc_factorization(M)
#階乗を計算しておく
factorial = calc_factorial(MAX_N)

res = 1
for c in C.items():
    res *= comb(factorial, (c[1] + N - 1), c[1], mod) #combinations_count(factorial, (c[1] + N - 1), c[1], mod)

print(res % mod)
### BUGGY CODE ###

# -*- coding: utf-8 -*-

n = int(input())

s_list = []
for i in range(n):
  s_tmp = input()
  if s_tmp not in s_list:
    s_list.append(s_tmp)
    
print(len(s_list))


### FIXED CODE ###

# -*- coding: utf-8 -*-

n = int(input())
s_set = {input() for i in range(n) }
print(len(s_set))
### BUGGY CODE ###

def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
import bisect
mod=998244353
n=i1()
d=[]
N=1<<(n.bit_length())
t=[-1 for i in range(2*N-1)]

def ud(i,x):
  i+=N-1
  t[i]=x
  while i:
    i=(i-1)//2
    t[i]=max(t[i*2+1],t[i*2+2]) 
     

def qr(a,b):
    a+=N-1
    b+=N-1
    L = -1
    R = -1
    while a < b:
      if a&1==0:
         L = max(L, t[a])
      if b&1==0:
         b-=1
         R = max(t[b], R)
      
      a>>=1
      b>>=1
      
         
    return max(L, R)
 
for i in range(n):
  d.append(i2())
d=sorted(d)
dx=[]
dd=[]
for i,j in d:
  dx.append(i)
  dd.append(j)

for i in range(n)[::-1]:
 j=bisect.bisect_left(dx,dx[i]+dd[i])
 tt=qr(i,j)
 ud(i,max(i,tt))
dp=[0 for i in range(n+1)]
dp[-1]=1
for i in range(n)[::-1]:
  dp[i]+=dp[i+1]
  dp[i]+=dp[t[i+N-1]+1]
  dp[i]%=mod
print(dp[0])

### FIXED CODE ###

def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
import bisect
mod=998244353
n=int(input())
d=[]
N=1<<(n.bit_length())
t=[-1 for i in range(2*N-1)]

def ud(i,x):
  i+=N-1
  t[i]=x
  while i:
    i=(i-1)>>1
    if t[i*2+1]>t[i*2+2]:t[i]=t[i*2+1]
    else:t[i]=t[i*2+2]
     

def qr(a,b):
    a+=N-1
    b+=N-1
    L = -1
    R = -1
    while a < b:
      if a&1==0:
         if L<t[a]:L = t[a]
      if b&1==0:
         b-=1
         if R<t[b]:R = t[b]
      
      a>>=1
      b>>=1
      
         
    return max(L, R)
 
for i in range(n):
  d.append([int(i) for i in input().split()])
d.sort()
dx=[]
dd=[]
for i,j in d:
  dx.append(i)
  dd.append(j)
for i in range(n)[::-1]:
 tx=dx[i]+dd[i]
 j=bisect.bisect_left(dx,tx)
 tt=qr(i,j)
 if j-1>tt:ud(i,j-1)
 else:ud(i,tt)
dp=[0 for i in range(n+1)]
dp[-1]=1
for i in range(n)[::-1]:
  dp[i]+=dp[i+1]
  dp[i]%=mod
  dp[i]+=dp[t[i+N-1]+1]
  dp[i]%=mod
print(dp[0])
### BUGGY CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, atan, degrees
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
ab = [LIST() for _ in range(N-1)]

graph = defaultdict(list)

edge = [[0]*N for _ in range(N)]
for a, b in ab:
	graph[a-1].append(b-1)
	graph[b-1].append(a-1)

K = 0
for i in graph:
	K = max(K, len(graph[i]))

q = deque()
q.append((0, None))

while q:
	i, color_from = q.popleft()
	can_use_color = list(range(1, K+1))
	if color_from:
		can_use_color.remove(color_from)
	for node in graph[i]:
		if not edge[i][node]:
			use_color = can_use_color.pop()
			edge[i][node] = use_color
			edge[node][i] = use_color
			q.append((node, use_color))

print(K)
for a, b in ab:
	print(edge[a-1][b-1])


### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, atan, degrees
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
	N = INT()
	ab = [LIST() for _ in range(N-1)]

	graph = defaultdict(list)

	# edge = [[0]*N for _ in range(N)]
	edge = defaultdict(int)
	for a, b in ab:
		graph[a-1].append(b-1)
		graph[b-1].append(a-1)

	K = 0
	for v in graph.values():
		K = max(K, len(v))
	color = list(range(1, K+1))

	q = deque()
	q.append((0, None))

	while q:
		i, color_from = q.popleft()
		tmp = -1
		for node in graph[i]:
			str_ = "{},{}".format(i, node)
			if not edge[str_]:
				use_color = color[tmp]
				if use_color == color_from:
					use_color = color[tmp-1]
					tmp -= 1
				tmp -= 1
				edge[str_] = use_color
				edge["{},{}".format(node, i)] = use_color
				q.append((node, use_color))
	print(K)
	for a, b in ab:
		print(edge["{},{}".format(a-1, b-1)])


if __name__ == "__main__":
	main()
### BUGGY CODE ###

R,G,B,N = map(int,input().split())
ans = 0
for r in range(N//R+1):
  for g in range(N//G+1):
    p = N-(r*R+g*G)
    if p%B==0 and p>=0:
      ans += 1
print(ans)

### FIXED CODE ###

R,G,B,N = map(int,input().split())
ans = 0
for r in range(N//R+1):
  for g in range(N//G+1):
    p = N-(r*R+g*G)
    if p%B==0 and p>=0:
      ans += 1
print(ans)
### BUGGY CODE ###

import itertools as tool

N, K = map(int, input().split())
a = [int(x) for x in input().split()]

beautifuls = []
for i in range(0, len(a)):
    for j in range(i+1, len(a)+1):
        beautiful = sum(a[i:j])
        beautifuls.append(beautiful)

beau_K = list(tool.combinations(beautifuls, K))
ands = []
for combi in beau_K:
    for i in range(K):
        if i == 0:
            tmp = combi[0]
        else:
            tmp = eval(str(bin(tmp & combi[i])))
    ands.append(eval(str(tmp)))
print(max(ands))


### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, K = MAP()
a = LIST()

l = []

for i in range(1, N+1):
	tmp = sum(a[:i])
	for j in range(N-i+1):
		l.append(tmp)
		tmp -= a[j]
		if j+i <= N-1:
			tmp += a[j+i]

ans = 0
for i in range(max(l).bit_length()-1, -1, -1):
	nextl = []
	for x in l:
		if (x>>i)&1:
			nextl.append(x)
	if len(nextl) >= K:
		ans += 1<<i
		l = nextl
print(ans)
### BUGGY CODE ###

N, M = list(map(int, input().split()))
alist = []
for m in range(M) :
    alist.append(int(input()))
    
a2 = 0
a1 = 1
for n in range(N) :
    a0 = (a1 + a2)*int((n+1) not in alist)%1000000007
    a2, a1 = a1, a0
else :
    print(a0)

### FIXED CODE ###

from functools import lru_cache
from sys import setrecursionlimit

n, m = map(int, input().split())
a = set(int(input()) for _ in range(m))

mod = 10**9+7
setrecursionlimit(mod)

@lru_cache(maxsize=n)
def stairway(i) :
    if i in a :
        return 0
    elif i == 0 :
        return 1
    elif i == 1 :
        return stairway(0)
    else :
        return (stairway(i-1)+stairway(i-2))%mod
    
print(stairway(n))
### BUGGY CODE ###

import math

N = input()
a = list(map(int, input().split()))
a_unique = list(set(a))
d = 0

for ai in a_unique:
    ni = a.count(ai)
    if ni < ai:
        d += ni
    else:
        d += ni - ai

print(d)



### FIXED CODE ###

import math

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

#リストから重複を取り除く
def f7(seq):
    seen = set()
    seen_add = seen.add
    return [ x for x in seq if x not in seen and not seen_add(x)]

d = 0

a_unique = {}

for i in range(0,len(a)):
    if a[i] in a_unique:
        a_unique[a[i]] += 1
    else:
        a_unique[a[i]] = 1

for ai in a_unique.keys():
    if a_unique[ai] >= ai:
        d += a_unique[ai] - ai
    else:
        d += a_unique[ai]

print(d)
### BUGGY CODE ###

def addbit(i):
    i += 1
    while i <= N:
        BIT[i] += 1
        i += i & (-i)
def getsum(i):
    ret = 0
    i += 1
    while i != 0:
        ret += BIT[i]
        i -= i&(-i)
    return ret
def bit(L):
    global BIT
    BIT=[0] * (N+1)
    re = 0
    for l in L:
        re += getsum(l)
        addbit(l)
    return N*(N-1)//2 - re
def calc(Z):
    Z.sort()
    l, r, lc, rc = -1<<28, 1<<28, N*(N-1)//4+1, N*(N-1)//4+1
    while (r - l) / max(abs(l), 1) > 0.000000001:
        m = (l+r) / 2
        A = [a&((1<<16)-1) for a in sorted([(int((s*m+t)*2**40)<<16)+i for i, (s, t) in enumerate(Z)])]
        c = bit(A)
        if c > N*(N-1)//4:
            l = m
            lc = (c - N*(N-1)//4) * 2
        else:
            r = m
            rc = (N*(N-1)//4 - c) * 2 + 1
    return l

N = int(input())
X, Y = [], []
for _ in range(N):
    a, b, c = map(int, input().split())
    X.append((-a/b, c/b))
    Y.append((-b/a, c/a))
print(calc(X), calc(Y))

### FIXED CODE ###

def addbit(i):
    i += 1
    while i <= N:
        BIT[i] += 1
        i += i & (-i)
def getsum(i):
    ret = 0
    i += 1
    while i != 0:
        ret += BIT[i]
        i -= i&(-i)
    return ret
def bit(L):
    global BIT
    BIT=[0] * (N+1)
    re = 0
    for l in L:
        re += getsum(l)
        addbit(l)
    return N*(N-1)//2 - re
def calc(Z):
    Z.sort()
    l, r, lc, rc = -1<<28, 1<<28, N*(N-1)//4+1, N*(N-1)//4+1
    f = 1
    while (r - l) / max(abs(l), 1) > 0.000000001:
        m = (l+r) / 2 if f else (l * rc + r * lc) / (lc + rc)
        A = [a&((1<<16)-1) for a in sorted([(int((s*m+t)*2**40)<<16)+i for i, (s, t) in enumerate(Z)])]
        c = bit(A)
        if c > N*(N-1)//4:
            l = m
            lc = (c - N*(N-1)//4) * 2
        else:
            r = m
            rc = (N*(N-1)//4 - c) * 2 + 1
        f ^= 1
    return l

N = int(input())
X, Y = [], []
for _ in range(N):
    a, b, c = map(int, input().split())
    X.append((-a/b, c/b))
    Y.append((-b/a, c/a))
print(calc(X), calc(Y))
### BUGGY CODE ###

from collections import deque
import sys
N=int(input())
numbers=[]
for _ in range(N-1):
    if __name__ == '__main__':
        u,v,w=sys.stdin.readline().split()
    numbers.append([int(u)-1,int(v)-1,int(w)])
inf=pow(10,9)
route=[[inf for _ in range(N)] for _ in range(N)]
for a in numbers:
    route[a[0]][a[1]]=a[2]
    route[a[1]][a[0]]=a[2]
visited_point=[inf for _ in range(N)]
visited_point[0]=0
stack=deque([0])
while len(stack)>0:
    n=stack.popleft()
    number=0
    for z in route[n]:
        if z==inf:
            number+=1
            continue
        if visited_point[number]==inf:
            visited_point[number]=visited_point[n]+z
            stack.append(number)
        number+=1
for a in visited_point:
    if a%2==0:
        print(0)
    else:
        print(1)


### FIXED CODE ###

from collections import deque
N=int(input())
numbers=[[] for _ in range(N)]
for _ in range(N-1):
    u,v,w=map(int,input().split())
    u-=1
    v-=1
    numbers[u].append((v,w%2))
    numbers[v].append((u,w%2))
inf=pow(10,9)
visited_point=[inf for _ in range(N)]
visited_point[0]=0
stack=deque([0])
while len(stack)>0:
    n=stack.pop()
    for v,w in numbers[n]:
        if visited_point[v]==inf:
            stack.appendleft(v)
            if w%2==0:
                visited_point[v]=visited_point[n]
            else:
                visited_point[v]=visited_point[n]^1
for a in visited_point:
    print(a)
### BUGGY CODE ###

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

d = [[False]*n for _ in range(n)]

for k in range(n):
  for i in range(n):
    for j in range(n):
      if mat[i][j] > mat[i][k]+mat[k][j]:
        print(-1)
        exit()

      if mat[i][j] == mat[i][k]+mat[k][j] and mat[i][k]>0 and mat[k][j]>0:
        d[i][j] = True

ans = 0
for i in range(n):
  for j in range(i+1, n):
    if not d[i][j]:
      ans += mat[i][j]

print(ans)

### FIXED CODE ###

import copy
N = int(input())

graph = []
for i in range(N):
  graph.append( list(map(int,input().split())) )

dp = copy.deepcopy(graph)
for k in range(N):
  for i in range(N):
    for j in range(N):
      dp[i][j] = min(dp[i][j], dp[i][k]+dp[k][j])

res = 0

for i in range(N):
  for j in range(N):
    if dp[i][j] < graph[i][j]:
      print(-1)
      exit()
    elif dp[i][j] == graph[i][j]:
      flg = True
      for k in range(N):
        if k!=i and k!=j and dp[i][j] == dp[i][k]+dp[k][j]:
          flg = False
      if flg:
        res += dp[i][j]

print(res//2)
### BUGGY CODE ###


n = int(input())

a = list(map(int, input().split()))
a.sort()


from functools import lru_cache
import sys
if n == 2:
    print(max(a))
    sys.exit()


@lru_cache(maxsize=100000)
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def gcd_list(li):
    g = gcd(li[0], li[1])
    for i in range(2, n):
        g = gcd(g, a[i])
    return g


def max_gcd(a):
    g = gcd_list(a)
    a = [a[i]//g for i in range(n)]

    m = 1
    for i in range(n):
        b = a[:]
        del b[i]
        gg = gcd_list(b)
        m = max(m, gg)

    print(g * m)


max_gcd(a)

### FIXED CODE ###


n = int(input())

a = list(map(int, input().split()))
a.sort(reverse=True)


from functools import lru_cache
import sys
if n == 2:
    print(max(a))
    sys.exit()


@lru_cache(maxsize=100000)
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x


def gcd_list(li):
    if len(li) == 1:
        return li[0]
    g = gcd(li[0], li[1])
    for i in range(2, len(li)):
        g = gcd(g, li[i])
    return g


def gcd_list_2(li):
    g = gcd(li[0], li[1])
    if g == 1:
        return max(gcd_list([li[0]] + li[2:]), gcd_list(li[1:]))
    for i in range(2, n):
        if gcd(g, li[i]) == 1:
            if i == n - 1:
                return gcd_list(li[:i])
            gg = gcd_list(li[i+1:])
            bb = [gcd(li[x], gg) for x in range(i+1)]
            bb.sort()
            return bb[1]
        else:
            g = gcd(g, li[i])
    return g


def max_gcd(a):
    g = gcd_list(a)
    a = [a[i]//g for i in range(n)]
    m = gcd_list_2(a)
    print(g * m)


max_gcd(a)
### BUGGY CODE ###

import numpy as np
import math 
n = int(input())
s = input()
a = np.zeros(n)
rgb = [[] for _ in range(3)]
rgb2 = np.zeros((3,n), int)
idx = {'R':0, 'G':1, 'B':2}
for i in range(n):
  rgb[idx[s[i]]].append(i)
  rgb2[idx[s[i]]][i] = 1
#

middles = [[] for _ in range(3)]
for i in rgb[0]:
  for j in rgb[1]:
    if(i+j >= 2*n-1):
      break
    if((i+j)%2 == 0):
      middles[idx['B']].append((i+j)//2)
for i in rgb[0]:
  for j in rgb[2]:
    if(i+j >= 2*n-1):
      break
    if((i+j)%2 == 0):
      middles[idx['G']].append((i+j)//2)
for i in rgb[1]:
  for j in rgb[2]:
    if(i+j >= 2*n-1):
      break
    if((i+j)%2 == 0):
      middles[idx['R']].append((i+j)//2)
#
counts = 0
for i in range(3):
  tmp,c = np.unique(middles[i], return_counts=True)
  for j,c in zip(tmp,c):
    if(j in rgb[i]):
      counts += c
print(len(rgb[0])*len(rgb[1])*len(rgb[2]) - counts)

### FIXED CODE ###

import numpy as np
n = int(input())
s = input()

r = s.count('R')
g = s.count('G')
b = s.count('B')

counts = 0
for i in range(n):
  for j in range(i+1, n):
    k = 2*j-i
    if(k >= n):
      break
    if(s[i] != s[j] and s[j]!=s[k] and s[k]!=s[i]):
      counts += 1
print(r*g*b - counts)
### BUGGY CODE ###

# 2020-05-22
from collections import deque


def main():
    n, m, k = [int(x) for x in input().split()]
    friends = [set() for _ in range(n)]
    blocks = [set() for _ in range(n)]
    for _ in range(m):
        a, b = [int(x) - 1 for x in input().split()]
        friends[a].add(b)
        friends[b].add(a)
    for _ in range(k):
        a, b = [int(x) - 1 for x in input().split()]
        blocks[a].add(b)
        blocks[b].add(a)
    ansers = []
    for person in range(n):
        qu = deque()
        dist = [-1] * n
        qu.append(person)
        dist[person] = 0
        while len(qu) > 0:
            new = qu.pop()
            for adj in friends[new]:
                if dist[adj] != -1:
                    continue
                qu.append(adj)
                dist[adj] = dist[new] + 1

        gen = (i not in blocks[person] and d > 1 for i, d in enumerate(dist))
        ansers.append(sum(gen))

    return ' '.join(str(x) for x in ansers)


if __name__ == '__main__':
    print(main())


### FIXED CODE ###

# 2020-05-22
def main():
    n, m, k = [int(x) for x in input().split()]
    friends = [set() for _ in range(n)]
    blocks = [set() for _ in range(n)]
    for _ in range(m):
        a, b = [int(x) - 1 for x in input().split()]
        friends[a].add(b)
        friends[b].add(a)
    for _ in range(k):
        a, b = [int(x) - 1 for x in input().split()]
        blocks[a].add(b)
        blocks[b].add(a)

    networks = {}  # The dict of networks as sets. Keys are leaders.
    net_leaders = [-1] * n  # The leaders of the networks that the ones joined.
    visited = [False] * n
    for person in range(n):
        if visited[person]:
            continue
        network = set()
        network_add = network.add
        stack = [person]
        stack_append = stack.append
        stack_pop = stack.pop
        while stack:
            new = stack_pop()
            visited[new] = True
            net_leaders[new] = person
            network_add(new)
            for adj in friends[new]:
                if visited[adj]:
                    continue
                stack_append(adj)
        networks[person] = network

    answers = []
    answers_append = answers.append
    for person in range(n):
        net = networks[net_leaders[person]]
        ans = len(net) - len(friends[person]) - 1
        for block in blocks[person]:
            if block in net:
                ans -= 1
        answers_append(ans)

    print(*answers)
    return


if __name__ == '__main__':
    main()
### BUGGY 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)
r.sort(reverse=True)

red = []
green = []

for i in range(x):
    red.append(p[i])
for j in range(y):
    green.append(q[j])

# print(red)
# print(green)

all = red + green
all.sort()
for mushoku in r:
    for i in range(len(all)):
        if mushoku > all[i]:
            all[i] = mushoku
print(sum(all))


### 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)
r.sort()


all = p[:x] + q[:y] + r
all.sort(reverse=True)

print(sum(all[:x+y]))
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(R, G, B, N):
    ans = 0
    r = -R
    for i in range(N//R + 1):
        r += R
        g = -G
        for j in range((N-r)//G + 1):
            g += G
            b = -B
            for k in range((N-r-g)//B + 1):
                b += B
                if r + g + b == N:
                    ans += 1

    return ans


def main():
    R, G, B, N = read_int_n()
    # A = [read_int_n() for _ in range(N)]
    print(slv(R, G, B, N))


if __name__ == '__main__':
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(R, G, B, N):
    ans = 0
    r = -R
    for i in range(N//R + 1):
        r += R
        g = -G
        for j in range((N-r)//G + 1):
            g += G
            if (N-r-g) % B == 0:
                ans += 1

    return ans


def main():
    R, G, B, N = read_int_n()
    # A = [read_int_n() for _ in range(N)]
    print(slv(R, G, B, N))


if __name__ == '__main__':
    main()