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

def resolve():
    k, s = map(int, input().split())
    cnt = 0
    k += 1
    for i in range(k):
        if i > s:
            break
        for j in range(i, k):
            if i + j > s:
                break
            for x in range(j, k):
                if i + j + x == s:
                    if i != j and j != x and x != i:
                        cnt += 6
                    elif i == j and j == x:
                        cnt += 1
                    else:
                        cnt += 3
                elif i + j + x > s:
                    break
    print(cnt)
resolve()

### FIXED CODE ###

def resolve():
    k, s = map(int, input().split())
    cnt = 0
    for i in range(k+1):
        if i > s:
            break
        for j in range(k+1):
            if 0 <= s-i-j <= k:
                cnt += 1
            elif s-i-j < 0:
                break
    print(cnt)
resolve()
### BUGGY CODE ###

from collections import deque

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

for _ in range(m):
    a,b=map(lambda x:int(x)-1,input().split())
    node[a].append(b)
    node[b].append(a)
    
#print(node)


seen=[False]*n
depth=[0]*n
todo=[]
todo.append(0)
    
    
while len(todo)>0:
    p=todo[0]
    
    seen[p]=True
    to=node[p]
    for i in to:
        if seen[i]:continue
        if not (i in todo):
            depth[i]+=depth[p]+1
            todo.append(i)
    todo.pop(0)



#print(depth)

sekai=[]

for i in range(1,n):
    for j in node[i]:
        if depth[j]<depth[i]:
            sekai.append(j+1)
            break
#print(sekai)

if len(sekai)!=(n-1):
    print('No')
else:
    print("Yes")
    for a in sekai:
        print(a)

### FIXED CODE ###

from collections import deque
 
n,m=map(int,input().split())
node=[[] for _ in range(n)]
 
for _ in range(m):
    a,b=map(lambda x:int(x)-1,input().split())
    node[a].append(b)
    node[b].append(a)
    
#print(node)
 

seen=[False]*n
depth=[-1]*n
todo=deque([])
todo.append(0)
depth[0]=1

    
while len(todo)>0:
    p=todo[0]
    
    seen[p]=True
    to=node[p]
    for i in to:
        if seen[i]:continue
        if depth[i]==-1:
            depth[i]=depth[p]+1
            todo.append(i)
    todo.popleft()
 
 

if min(depth)==-1:
    print('No')
else:
    print("Yes")
    for i in range(1,n):
        for j in node[i]:
            if depth[i]>depth[j]:
                print(j+1)
                break
### BUGGY CODE ###

# listの各要素に人数を格納. 一番後ろに全員たどり着いたら終わり

list = [0] * 6
n_move = []

N = int(input())

for i in range(5) : 
    n_move.append(int(input()))


list[0] += N
time = 0

while list[-1] < N : 
    for i in range(4, -1, -1) : 
        if n_move[i] <= list[i] : 
            list[i+1] += n_move[i]
            list[i] -= n_move[i]
        else : 
            list[i+1] += list[i]
            list[i] = 0
    time += 1
    
print(time)

### FIXED CODE ###

# listの各要素に人数を格納. 一番後ろに全員たどり着いたら終わり

list = [0] * 6
n_move = []
time = 4

N = int(input())

for i in range(5) : 
    n_move.append(int(input()))
    
n_min = min(n_move)

if(N % n_min == 0) : 
    time += N // n_min
else : 
    time += N // n_min + 1

print(time)
### BUGGY CODE ###

n,q=[int(j) for j in input().split()]
l=[]
for i in range(n):
    s,t,x=[int(j) for j in input().split()]
    l.append((s-x,1,x))
    l.append((t-x,0,x))

for i in range(q):
    d=int(input())
    l.append((d,2,i))

l.sort()

ans=[-1]*q
ll=set()
m=10**18
p=False
for i,j,x in l:
    if j==1:
        ll.add(x)
        if m>x:
            m=x
            p=True
    elif j==0:
        ll.remove(x)
        if x==m:
            p=False
    else:
        if not p:
            if ll:
                p=True
                m=min(ll)
            else:
                m=-1
        ans[x]=m

for i in ans:
    print(i)



### FIXED CODE ###

import sys
input = sys.stdin.readline
n,q=[int(j) for j in input().split()]
l=[]
for i in range(n):
    s,t,x=[int(j) for j in input().split()]
    l.append((s-x,1,x))
    l.append((t-x,0,x))

for i in range(q):
    d=int(input())
    l.append((d,2,i))

l.sort()

ans=[-1]*q
ll=set()
m=10**18
p=False
for i,j,x in l:
    if j==1:
        ll.add(x)
        if m>x:
            m=x
            p=True
    elif j==0:
        ll.remove(x)
        if x==m:
            p=False
    else:
        if not p:
            if ll:
                p=True
                m=min(ll)
            else:
                m=-1
        ans[x]=m
print('\n'.join(map(str,ans)))
### BUGGY CODE ###

import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())[:-1]
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [list(input())[:-1] for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
N,S = map(int,input().split())
MOD = 998244353
A = list(map(int,input().split()))
d1 = deque([0])
d2 = deque([[]])
ans = []
for i in range(N):
    a = A[i]
    n = len(d1)
    for j in range(n):
        v = d1.popleft()
        li = d2.popleft()
        vv = deepcopy(v)
        lili = deepcopy(li)
        d1.append(vv)
        d2.append(lili)
        v = v+a
        li.append(i)
        if v > S:
            continue
        elif v < S:
            d1.append(v)
            d2.append(li)
        else:
            ans.append(li)
pri = 0
for lis in ans:
    l = len(lis)
    p = N-l
    pri += pow(2,p,MOD) 
    pri %= MOD
print(pri)

    

### FIXED CODE ###

import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())[:-1]
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [list(input())[:-1] for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]

N,S = map(int,input().split())
MOD = 998244353
A = list(map(int,input().split()))
dp = [[0]*(S+1) for _ in range(N)]
if A[0] <= S:
    dp[0][A[0]] = 1
dp[0][0] = 2
for i in range(1,N):
    a = A[i]
    for j in range(S+1):
        dp[i][j] += 2*dp[i-1][j] % MOD
        if j - a < 0:
            continue
        else:
            dp[i][j] += dp[i-1][j-a]
        dp[i][j] %= MOD
print(dp[N-1][S])
### BUGGY CODE ###

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

# define combination
fact = [1, 1]
for i in range(2, N+1):
    fact.append(fact[-1]*i)
combs = [0, 0]
for n in range(2, N+1):
    combs.append(fact[n] // (fact[n - 2] * 2))

# process
nums = [0]*(N+1)
for a in A:
    nums[a] += 1

sumall = 0
for n in nums:
    sumall += combs[n]

ans = []
for i, a in enumerate(A):
    ans.append(sumall - combs[nums[a]] + combs[nums[a]-1])

# output
for a in ans:
    print(a)


### FIXED CODE ###

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

# define combination
combs = [0, 0]
for i in range(2, N+1):
    combs.append(i*(i-1)//2)

# process
nums = [0]*(N+1)
for a in A:
    nums[a] += 1

sumall = 0
for n in nums:
    sumall += combs[n]

ans = [sumall]*N
for i, a in enumerate(A):
    n = nums[a]
    ans[i] += combs[n-1] - combs[n]

# output
for a in ans:
    print(a)
### BUGGY CODE ###

T = input()
L = len(T)
if T[0] is "?" and L > 1 :
    if T[1] is "D":
        T = 'P' + T[1:]
    else:
        T = 'D' + T[1:]
if T[L-1] is "?":
    T = T[:L-1] + 'D'
for i in range(1,L):
    if T[i] is "?":
        if T[i-1] is "P":
            T = T[:i] + 'D' + T[i+1:]
        elif T[i-1] is "D":
            T = T[:i] + 'P' + T[i+1:]
print(T)

### FIXED CODE ###

T = input()
L = len(T)
if T[0] is "?" and L > 1 :
    if T[1] is "D":
        T = 'P' + T[1:]
    else:
        T = 'D' + T[1:]
if T[L-1] is "?":
    T = T[:L-1] + 'D'
T = T.replace("P?", "PD")
T = T.replace("?P", "DP") 
T = T.replace("?","D")

print(T)
### BUGGY CODE ###

import sys,heapq
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
def ddprint(x):
  if DBG:
    print(x)

n,m = inm()
dst = [ set() for i in range(n) ]
for i in range(m):
    u,v = inm()
    u -= 1
    v -= 1
    dst[v].add(u)
s,t = inm()
s -= 1
t -= 1

reach2 = [ set() for i in range(n) ]
m2done = [ False for i in range(n) ]
reach3 = [ set() for i in range(n) ]
m3done = [ False for i in range(n) ]

def mark(f):
    x = set()
    if not m2done[f]:
        y = set()
        for v1 in dst[f]:
            for v2 in dst[v1]:
                y.add(v2)
        reach2[f] = y
        m2done[f] = True

    for v2 in reach2[f]:
                for v3 in dst[v2]:
                    if v3 == f:
                        continue
                    x.add(v3)
    reach3[f] = x
    m3done[f] = True

dist = [-1] * n
dist[t] = 0
q = deque([(t,0)])
while len(q)>0:
    v,d = q.popleft()
    if not m3done[v]:
        mark(v)
    for nxt in reach3[v]:
        if dist[nxt] > -1:
            continue
        if nxt==s:
            print(d+1)
            exit()
        dist[nxt] = d+1
        q.append((nxt,d+1))
print(-1)


### FIXED CODE ###

import sys,heapq
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True  and False
def ddprint(x):
  if DBG:
    print(x)

n,m = inm()
dst = [ [] for i in range(n*3) ]
for i in range(m):
    u,v = inm()
    u -= 1
    v -= 1
    dst[u].append(v+n)
    dst[u+n].append(v+n*2)
    dst[u+n*2].append(v)
s,t = inm()
s -= 1
t -= 1
ddprint(dst)

dist = [-1] * (n*3)
dist[s] = 0
q = deque([s])
while len(q)>0:
    v = q.popleft()
    #ddprint('v='+str(v))
    for nxt in dst[v]:
        #ddprint('nxt='+str(nxt))
        if nxt==t:
            print((dist[v]+1)//3)
            exit()
        if dist[nxt] > -1:
            continue
        dist[nxt] = dist[v]+1
        q.append(nxt)
    #ddprint(dist)
    #ddprint(q)
print(-1)
### BUGGY CODE ###

N, K = map(int, input().split())
h = [int(input()) for _ in range(N)]
h.sort()

ans = float('inf')
for i in range(N-K+1):
    m = min(h[i:i+K])
    M = max(h[i:i+K])
    ans = min(ans,M-m)
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
h = [int(input()) for _ in range(N)]
h.sort()

ans = float('inf')
for i in range(N-K+1):
    ans = min(ans,h[i+K-1]-h[i])
print(ans)
### BUGGY CODE ###

n, m = list(map(int, input().split()))
l = []
r = []
for i in range(m):
    x, y=[int(i) for i in input().split()]
    l.append(x)
    r.append(y)
ans = 0
for i in range(n):
    cnt = 0
    for j in range(m):

        for k in range(l[j], r[j]+1):
            if i + 1 == k:
                cnt += 1
        if cnt == m:
            ans += 1
print(ans)

### FIXED CODE ###

n, m = list(map(int, input().split()))
maxl = 0
minr = 1000000
for i in range(m):
    l, r = list(map(int, input().split()))
    maxl = max(maxl, l)
    minr = min(minr, r)
if minr < maxl:
    print(0)
else:
    print(minr - maxl + 1)
### BUGGY CODE ###

n = int(input())
r = list(map(int,input().split()))
_sum = 0
o = 1
p= len(r)
z =[]
for g in range(p):
    v = r[g]%(10**9+7)
    z.append(v)
y = len(z)
for i in range(y-1):
    a = z[i]
    #print("a:" +str(a))
    for j in range(y-i-1):
        b=z[i+j+1]
    #print("b:"+str(b))
        _sum += (a*b)
        #print("_sum:"+str(_sum))
print(_sum % (10**9+7))
    

### FIXED CODE ###

n = int(input())
t = 10**9+7
z = list(map(int,input().split() ))
_sum = 0
x = sum(z)
y = len(z)
for i in range(y-1):
    x = x-z[i]
    _sum += (z[i]*x)
        #print("_sum:"+str(_sum))
print(_sum%t)
### BUGGY CODE ###

from sys import stdin
import math
import itertools
import re
import sys
sys.setrecursionlimit(10**8)
 
 
def makeIntMatrix(lines):
    intMatrix = []
    for a in makeStringMatrix(lines):
        intMatrix.append([int(b) for b in a])
    return intMatrix
 
 
def makeStringMatrix(lines):
    stringMatrix = [line.split() for line in lines]
    return stringMatrix
 
 
def makeInt(line):
    return int(line.rstrip())
 
 
def makeMultiInteger(line):
    return [int(x) for x in line.rstrip().split()]
 
dp = {}
T = {}
 
def solve(input_string):
    S = input_string[1]
    intMatrix = makeIntMatrix(input_string[2:])
    #print(input_string[2:])
    for line in intMatrix:
        L, R = line
        #print(l, r)
        #print(S[l:r+1])
        #cnt = len(re.findall(r'AC', S[l-1:r]))
        totalCnt = cntAC(L, R, S)
        print(totalCnt)
    return
 

"""
wrong answer
def cntAC(l, r, D, S, cnt):
    global dp
    global T
    if r-l == D+1:
        return cnt
    if str(l)+str(r) not in T:
        T[str(l)+str(r)] = S[l-1:r]
        t = T[str(l)+str(r)]
    if str(l)+str(r) not in dp:
        #print(t)
        dp[str(l)+str(r)] = len(t.split('AC'))-1
        cnt = dp[str(l)+str(r)]
        return cntAC(l-1, r, D, S, cnt)
    else:
        cnt = dp[str(l)+str(r)]
        return cntAC(l-1, r, D, S, cnt)
"""
 

"""
wrong answer
def cntAC(L, r, S):
    global dp
    global T
    for l in range(L, r)[::-1]:
        if str(l)+str(r) not in T:
            T[str(l)+str(r)] = S[l-1:r]
            t = T[str(l)+str(r)]
        else:
            t = T[str(l)+str(r)]
        if str(l)+str(r) not in dp:
            dp[str(l)+str(r)] = len(t.split('AC'))-1
            cnt = dp[str(l)+str(r)]
        else:
            cnt = dp[str(l)+str(r)]
    return cnt
"""
 
def cntAC(L, R, S):
    cnt = 0
    for l in range(L, R):
        t = S[l-1:l+1]
        cnt +=  1 if t == 'AC' else 0
    return cnt

def main():
    input_lines = stdin.readlines()
    answer = solve(input_lines)
    #print(answer)
 
 
if __name__ == '__main__':
    main()


### FIXED CODE ###

N, Q = map(int, input().split())
S = input()
t=[0]*(N+1)
for i in range(N):
  t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
for i in range(Q):
  l, r = map(int, input().split())
  print(t[r-1] - t[l-1])
### BUGGY CODE ###

n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
x.sort(reverse = False)
for i in range(1,n):
    if i in x:
        a = x.count(i)
        print(a)
        for s in range(a):
            del x[0]
    else:
        print(0)
print(0)

### FIXED CODE ###

import collections

n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
#x.sort(reverse = False)
c = collections.Counter(x)
for i in range(1,n):
    print(c[i])
print(0)
### BUGGY CODE ###

import collections
from collections import defaultdict
N = int(input())
edges = []
vertexes = []
count = defaultdict(int)
parent = {}
childs = defaultdict(list)
color_dict = defaultdict(dict)
for i in range(N-1):
  a, b = map(int, input().split())
  parent[b] = a
  childs[a].append(b)
  edges.append((a,b))
  vertexes.append(a)
  vertexes.append(b)
  
#print(edges)
#print(vertexes)
#print(parent)
#childs = dict(childs)
#print(childs)

c = collections.Counter(vertexes)
max_color = max(c.values())
print(max_color)

parent_color = {1: -1}
for i in range(1, N):
  if i not in childs:
    continue
  pc = parent_color[i]
  allowed_colors = [j for j in range(1, max_color + 1) if j != pc]
  for child, color in zip(childs[i], allowed_colors):
    color_dict[i][child] = color
    parent_color[child] = color
    
#print(color_dict)

for e in edges:
  print(color_dict[e[0]][e[1]])


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
m = map(int,read().split())
AB = list(zip(m,m))

# make graph
# graph(x): xと繋がっている頂点（番号）のリスト
graph = [[] for _ in range(N+1)]
for a,b in AB:
  graph[a].append(b)
  graph[b].append(a)

# 深さ優先探索で、頂点の探索順序を作成
root = 1
parent = [0] * (N+1) # parent[x]: xの親の番号
order = [] # 深さ優先探索の順序リスト
stack = [root]
while stack:
  x = stack.pop()
  order.append(x)
  for y in graph[x]:
    if y == parent[x]:
      continue
    parent[y] = x
    stack.append(y)

# color[i]: 頂点iとその親の間の辺の色
color = [-1] * (N+1)

# 頂点の探索順ごとに、頂点とその子の間の辺の色を決定
for x in order:
  ng = color[x] # 頂点xとxの親との間の辺の色
  c = 1
  # 頂点xとつながっている頂点のリストを取得し、辺の色を1から順に割り当てる
  for y in graph[x]:
    if y == parent[x]: # xの親の頂点の場合は何もしない
      continue
    if c == ng: # xとその親との間の辺の色は割り当てないようにする
      c += 1
    color[y] = c
    c += 1

# 回答作成
answer = []
for a,b in AB:
  # aがbの子ならcolor[a]を、逆の場合はcolor[b]を出力する
  if parent[a] == b:
    answer.append(color[a])
  else:
    # 今回の場合、a_i < b_iで、番号の小さい方が親になるように木を作っているので、
    # こちらの条件のほうにしか引っかからないはず
    answer.append(color[b])

K = max(answer) # 色の番号の中で最も大きいものがK
print(K)
print('\n'.join(map(str,answer)))
### BUGGY CODE ###

s = input()
k = int(input())

k_list = set(s) 
for i in range(2, len(s)+1):
    for j in range(len(s)+1-i):
        sub = s[j:j+i]
        k_list.add(sub)
    if len(k_list) > k * len(s):
        break

k_list = list(k_list)
k_list.sort()
print(k_list[k-1])

### FIXED CODE ###

s = input()
k = int(input())

kn = len(s) * k
k_list = set(s)

for i in range(2, k+1):
    for j in range(len(s)):
        k_list.add(s[j:j+i])

k_list = list(k_list)
k_list.sort()
print(k_list[k-1])
### BUGGY CODE ###

import math
from functools import reduce

def gcd(*numbers):
	 return reduce(math.gcd, numbers)


k = int(input())
sum = 0

for i in range(1, k+1):
	for j in range(1, k+1):
		for l in range(1, k+1):
			sum += gcd(i, j, l)

print(sum)


### FIXED CODE ###

# def gcd(a, b):
# 	while a != 0 and b != 0:
# 		if a >= b:
# 			remain = a % b
# 			a = remain
# 		else:
# 			remain = b % a
# 			b = remain
# 	if a >= b:
# 		return a
# 	else:
# 		return b 

import math

k = int(input())
sum = 0

for i in range(1, k+1):
	for j in range(1, i+1):
		for l in range(1, j+1):
			if i == j and j == l:
				sum += i
			elif i == j or j == l:
				a = math.gcd(i, j)
				b = math.gcd(j,l)
				g = math.gcd(a,b)
				sum += g*3

			else:
				a = math.gcd(i, j)
				b = math.gcd(j,l)
				g = math.gcd(a,b)
				sum += g*6

print(sum)
### BUGGY CODE ###

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)

final_ans = sorted([a[ai] + b[bi] +c[ci] for ai in range(len(a)) for bi in range(len(b)) for ci in range(len(c)) if (ai+1)*(bi+1)*(ci+1) <=k],reverse=True)[:k]

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

### FIXED CODE ###

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)

sumAB = sorted([ai + bi for ai in a for bi in b],reverse=True)[:k]
final_ans = sorted([ci + abi for ci in c for abi in sumAB],reverse = True)[:k]

for i in range(k):
    print(final_ans[i])
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split())) 
ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        if A[i] + A[j] == abs(i-j):
            ans += 1
print(ans)

### FIXED CODE ###

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

"""
A[i] + A[j] = j - i
A[i] + i = j - A[j]

a = A[i] + i
b = j - A[j]
"""

ans = 0
dic = {}

for i in range(N-1, -1, -1):
    wa = A[i] + i
    if wa in dic:
        ans += dic[wa]
    sa = i - A[i]
    if sa in dic:
        dic[sa] += 1
    else:
        dic[sa] = 1
print(ans)
### BUGGY CODE ###

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

import networkx as nx

def connected_components(G):
    seen={}
    for v in G:
        if v not in seen:
            c = nx.algorithms.shortest_paths.single_source_shortest_path_length(G, v)
            yield list(c)
            seen.update(c)

edges = []
for _ in range(M):
    i,j=map(int, input().split())
    edges.append([i-1,j-1])
G = nx.Graph()
G.add_nodes_from(range(N))
G.add_edges_from(edges)
#sg = nx.connected_components(G)
sg = connected_components(G)
connected = sorted(sg, key=len)
print(len(connected[-1]))


### FIXED CODE ###

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

class UnionFind():
    def __init__(self, n):
        self.n = n # ノード数
        self.parents = [-1]*n # 各ノードごとのparent

    def find(self, x):
        # 自身が根であれば
        if self.parents[x]<0:
            return x
        # そうでなければ、再帰的に繰り返し、自身の根を探索
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        # それぞれの根
        x = self.find(x)
        y = self.find(y)

        # 根が同一であれば
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x,y = y,x
        self.parents[x]+=self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

uf = UnionFind(N)
for _ in range(M):
    i, j = map(int, input().split())
    i-=1
    j-=1
    uf.union(i,j)

max_size = 0
for i in range(N):
    if uf.parents[i]<0:
        size = uf.size(i)
        if max_size<size:
            max_size = size
print(max_size)
### BUGGY CODE ###

import itertools
S = input()

l = len(S)

ans = 0
for s, e in itertools.combinations(range(l+1), 2):
  if int(S[s:e]) % 2019 == 0:
    ans += 1

print(ans)

### FIXED CODE ###

S = input()
r = 1
arr = [0]

for c in S[::-1]:
  arr.append((arr[-1] + int(c) * r) % 2019)
  r *= 10
  r %= 2019
from collections import Counter
ctr = Counter(arr)
ans = 0
for v in ctr.values():
  ans += v*(v-1)//2
print(ans)
### 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):
        rest = N - r * R - g * G
        if rest >=0 and rest % B == 0:
            ans += 1
print(ans)


### FIXED CODE ###

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

print(solve())