Harryxun/stf_run huggingface dataset:
(n, x) = map(int, input().split())
l = list(map(int, input().split()))

count = 0
for i in range(n - 1):
    if count > x:
        ans = i
        break
    else:
        count += l[i]
print(ans)

### FIXED CODE ###

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

d = 0
ans = 0
for i in l:
    if d > x:
        break
    else:
        d += i
        ans += 1

if x >= sum(l):
    ans += 1

print(ans)
S = input()

print( 2018 + S[:4])

### FIXED CODE ###

S = input()
print("2018"+S[4:])
N = int(input())
H = [int(n) for n in input().split()]
Hd = []
for i in range(N-1):
    Hd.append(H[i]-H[i+1])
ans_list = [0]*N
J =0
for i in range(N-1):
    if i < J:
        continue
    if Hd[i] >= 0:
        candidate = 1
        for j in range(i+1,N-1):
            if Hd[j] >= 0:
                candidate += 1
            else:
                J = j
                break
        ans_list[i] = candidate
print(max((ans_list)))

### FIXED CODE ###

S = input()
T = input()
ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans +=1
print(ans)
# -*- coding: utf-8 -*-

H, W = map(int, input().split())
s = []

for i in range(H):
    s.append(list(input()))

for i in range(H):
    for j in range(W):
        OK_cnt = 0
        if s[i][j] == '#':
            #上
            if j > 0 and s[i][j-1] == '#':
                OK_cnt += 1
            #右
            if i+1 < W and s[i+1][j] == '#':
                OK_cnt += 1
            #下
            if j+1 < H and s[i][j+1] == '#':
                OK_cnt += 1
            #左
            if i > 0 and s[i-1][j] == '#':
                OK_cnt += 1
            if OK_cnt == 0:
                print('No')
                exit()

print('Yes')


### FIXED CODE ###

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

H, W = map(int, input().split())
s = []

for i in range(H):
    s.append(list(input()))

for i in range(H):
    for j in range(W):
        OK_cnt = 0
        if s[i][j] == '#':
            #上
            if j > 0 and s[i][j-1] == '#':
                OK_cnt += 1
            #右
            if i+1 < H and s[i+1][j] == '#':
                OK_cnt += 1
            #下
            if j+1 < W and s[i][j+1] == '#':
                OK_cnt += 1
            #左
            if i > 0 and s[i-1][j] == '#':
                OK_cnt += 1
            if OK_cnt == 0:
                print('No')
                exit()

print('Yes')
def insertionSort( nums, n, g ):
	cnt = 0
	i = g
	while i < n:
		v = nums[i]
		j = i - g
		while 0 <= j and v < nums[j]:
			nums[ j+g ] = nums[j]
			j -= g
			cnt += 1
		nums[ j+g ] = v
		i += 1
	return cnt

n = int( input( ) )
nums = []
for i in range( 0, n ):
	nums.append( int( input( ) ) )

cnt = 0
g = []
val =0
for i in range( n ):
	val = 3*val+1
	if  n < val:
		break
	g.append( val )
	
g.reverse( )
m = len( g )
print( m )
print( " ".join( map( str, g ) ) )
for i in range( m ):
	cnt += insertionSort( nums, n, g[i] )
print( cnt )

print( "\n".join( map( str, nums ) ) )

### FIXED CODE ###

import sys
 
def insertionSort( nums, n, g ):
    cnt = 0
    i = g
    while i < n:
        v = nums[i]
        j = i - g
        while 0 <= j and v < nums[j]:
            nums[ j+g ] = nums[j]
            j -= g
            cnt += 1
        nums[ j+g ] = v
        i += 1
    return cnt
         
def shellSort( nums, n ):
    g = []
    val = 1
    while val <= n:
        g.append( val )
        val = 3*val+1
     
    g.reverse( )
    m = len( g )
    print( m )
    print( " ".join( map( str, g ) ) )
    cnt = 0
    for i in range( m ):
        cnt += insertionSort( nums, n, g[i] )
    print( cnt )
     
n = int( sys.stdin.readline( ) )
nums = []
for i in range( n ):
    nums.append( int( sys.stdin.readline( ) ) )
 
shellSort( nums, n )
print( "\n".join( map( str, nums ) ) )
a = int(input())
b = int(input())
op = + or -

print(a op b)



### FIXED CODE ###

A, op, B = input().split()

if op =="+":
    print(int(A) + int(B))
elif op == "-":
    print(int(A) - int(B))
def howmany(z):
    if z == -1 or z == 0 or z == 1:
        return(1)
    elif z == 2:
        return(2)
    else:
        return howmany(z-1) + howmany(z-2)

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

x = 1
a = [0]*(m+2)
a[0] = -1
a[m+1] = n

for i in range(1,m+1):
    a[i] = int(input())

if m == 0:
    print(howmany(n))

elif all(a[i+1]-a[i] != 1 for i in range(1,m+1)):
    for i in range(1,m+1):
        x *= howmany(a[i] - a[i-1] -2)
    x *= howmany(a[m+1]-a[m]-1)
    print(x % 1000000007)

else: print(0)
    

### FIXED CODE ###

def howmany(n):
    if n <= 1:
        return n
    result = [1, 0, 0, 1]
    matrix = [1, 1, 1, 0]
    while n > 0:
        if n % 2:
            result = mul(matrix, result)
        matrix = mul(matrix, matrix)
        n //= 2
    return result[2]

def mul(a, b):
    return [a[0]*b[0] + a[1]*b[2],
            a[0]*b[1] + a[1]*b[3],
            a[2]*b[0] + a[3]*b[2],
            a[2]*b[1] + a[3]*b[3]]


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

x = 1
a = [0]*(m+2)
a[0] = -1
a[m+1] = n

if m == 0:
    print(howmany(n+1) % 1000000007)
else:
    for i in range(1,m+1):
        a[i] = int(input())

    if all(a[i+1]-a[i] != 1 for i in range(1,m)):
        for i in range(1,m+1):
            if a[i] - a[i-1] > 1:
                x *= howmany(a[i] - a[i-1] -1)
        if a[m] + 1 == n:
            print(x % 1000000007)
        else:
            x *= howmany(a[m+1]-a[m])
            print(x % 1000000007)
    else: print(0)
import math
import copy
import sys
import fractions
# import numpy as np
# import statistics
import decimal
import heapq
import collections
import itertools
import bisect

# from operator import mul

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputIntList():
    outputDataList = []
    inputData = input().split()
    outputDataList = [int(n) for n in inputData]

    return outputDataList


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===
MOD = 10 ** 9 + 7

n, k = map(int, input().split())
n += 1

sum_mat = [0]
for i in range(1, 2*(10**5)+1):
    sum_mat.append(sum_mat[i-1]+i)


ans = 0
for i in range(k, n + 1):
    top = sum_mat[i]
    bottom = sum_mat[i-1] - 1
    ans += (i * n - top - bottom) % MOD
    ans %= MOD

print(ans)


### FIXED CODE ###

import math
import copy
import sys
import fractions
# import numpy as np
# import statistics
import decimal
import heapq
import collections
import itertools
import bisect

# from operator import mul

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputIntList():
    outputDataList = []
    inputData = input().split()
    outputDataList = [int(n) for n in inputData]

    return outputDataList


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===
MOD = 10 ** 9 + 7

n, k = map(int, input().split())
n += 1

sum_mat = [0]
for i in range(1, 2*(10**5)+3):
    sum_mat.append(sum_mat[i-1]+i)


ans = 0
for i in range(k, n + 1):
    top = sum_mat[i]
    bottom = sum_mat[i-1] - 1
    ans += (i * n - top - bottom) % MOD
    ans %= MOD

print(ans)
s = input()
li = [-1,1]
a = '+'
b = '+'
c = '+'
for i in li:
	for j in li:
		for k in li:
			if int(s[0])+(i*int(s[1]))+(j*int(s[2]))+(k*int(s[3])) == 7:
				if i == -1:
					a = '-'
				if j == -1:
					b = '-'
				if k == -1:
					c = '-'
				print(s[0] + a + s[1] + b + s[2] + c + s[3] + '=7')
				break
		else:
			continue
		break
	else:
		contiue
	break


### FIXED CODE ###

s = input()
li = [-1,1]
a = '+'
b = '+'
c = '+'
for i in li:
	for j in li:
		for k in li:
			if int(s[0])+(i*int(s[1]))+(j*int(s[2]))+(k*int(s[3])) == 7:
				if i == -1:
					a = '-'
				if j == -1:
					b = '-'
				if k == -1:
					c = '-'
				print(s[0] + a + s[1] + b + s[2] + c + s[3] + '=7')
				break
		else:
			continue
		break
	else:
		continue
	break
def find_max_expectation( P, K ):
    # P is a np.array( N, )
    # K is a int
    
    if( len(P)==0 ):
        return np.nan
    
    st_idx  = 0
    max_sum = 0
    for nn in range( K ):
        max_sum += P[nn]
    
    tmp = max_sum
    for nn in range( K, len(P) ):
        tmp -= P[nn-K]
        tmp += P[nn]
        if( tmp > max_sum ):
            st_idx = nn-K+1
        
    ans = 0
    for nn in range( st_idx, st_idx+K ):
        tmp = 1 + 0.5*( P[nn]-1 )
        ans += tmp
    
    return ans


# input
N, K = map( int, input().split() )
P    = np.array( [int(x) for x in input().split()] )

print( find_max_expectation( P, K ) )

### FIXED CODE ###

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

# calc cumsum
C    = list()
cumsum = 0
for ii in range( len(P) ):
    E = (1+P[ii])/2
    C.append( cumsum + E )
    cumsum += E

ans = 0.0
if( N==K ):
    ans = C[-1]
for ii in range( K, N ):
    E = C[ii] - C[ii-K]
    if( ans < E ):
        ans = E

# output        
print( ans )
i = 0
j = i+1
ans = 0
while i != n - 1:
  ans += a[i] * a[j]
  j += 1
  if j == n:
    i += 1
    j = i + 1
print(ans % 1000000007)

### FIXED CODE ###

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

sum = [0 for i in range(n+1)]
for i in range(n - 1, -1, -1):
    sum[i] = sum[i + 1] + a[i]
ans = 0
for i in range(n):
    ans = (ans+(a[i]*sum[i+1])) % 1000000007
print(ans)
a = int(input())
b = int(input())

if a*b % 2 == 0:
    print("Even")
else:
    print("Odd")



### FIXED CODE ###

a, b = map(int, input().split())
if a*b % 2 == 0:
    print("Even")
else:
    print("Odd")
"""
Union-Find Tree / Disjoint Set Union (DSU)
"""


def init_unionfind(N):
    global parent, rank, NUM_VERTEX
    NUM_VERTEX = N
    parent = [-1] * N
    rank = [0] * N


def find_root(x):
    p = parent[x]
    if p == -1:
        return x
    p2 = find_root(p)
    parent[x] = p2
    return p2


def unite(x, y):
    x = find_root(x)
    y = find_root(y)
    if x == y:
        return  # already united
    if rank[x] < rank[y]:
        parent[x] = y
    else:
        parent[y] = x
        if rank[x] == rank[y]:
            rank[x] += 1


def is_connected(x, y):
    return (find_root(x) == find_root(y))


def num_components():
    return len(set(find_root(x) for x in range(NUM_VERTEX)))

# --- end of library ---


def main_yosupo():
    # verified: https://judge.yosupo.jp/problem/unionfind
    N, Q = [int(x) for x in input().split()]
    init_unionfind(N)
    for q in range(Q):
        typ, u, v = [int(x) for x in input().split()]
        if typ == 0:
            unite(u, v)
        else:
            print(1 if is_connected(u, v) else 0)


def main_abl():
    N, M = map(int, input().split())
    init_unionfind(N)
    for _i in range(M):
        a, b = map(int, input().split()))
        unite(a - 1, b - 1)

    return num_components() - 1


if __name__ == "__main__":
    # main_yosupo()
    main_abl()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)
INF = 10 ** 9 + 1  # sys.maxsize # float("inf")
MOD = 10 ** 9 + 7


def init_unionfind(N):
    global parent, rank
    parent = [-1] * N
    rank = [0] * N


def find_root(x):
    p = parent[x]
    if p == -1:
        return x
    p2 = find_root(p)
    parent[x] = p2
    return p2


def unite(x, y):
    x = find_root(x)
    y = find_root(y)
    if x == y:
        return  # already united
    if rank[x] < rank[y]:
        parent[x] = y
    else:
        parent[y] = x
        if rank[x] == rank[y]:
            rank[x] += 1


def is_connected(x, y):
    return (find_root(x) == find_root(y))


def debug(*x):
    print(*x, file=sys.stderr)


def solve(N, M, edges):
    init_unionfind(N)
    for e in edges:
        unite(e[0] - 1, e[1] - 1)

    s = set(find_root(x) for x in range(N))

    return len(s) - 1


def main():
    # parse input
    N, M = map(int, input().split())
    edges = []
    for _i in range(M):
        edges.append(tuple(map(int, input().split())))

    print(solve(N, M, edges))


# tests
T1 = """
3 1
1 2
"""
TEST_T1 = """
>>> as_input(T1)
>>> main()
1
"""


def _test():
    import doctest
    doctest.testmod()
    g = globals()
    for k in sorted(g):
        if k.startswith("TEST_"):
            doctest.run_docstring_examples(g[k], g, name=k)


def as_input(s):
    "use in test, use given string as input file"
    import io
    f = io.StringIO(s.strip())
    g = globals()
    g["input"] = lambda: bytes(f.readline(), "ascii")
    g["read"] = lambda: bytes(f.read(), "ascii")


input = sys.stdin.buffer.readline
read = sys.stdin.buffer.read

if sys.argv[-1] == "-t":
    print("testing")
    _test()
    sys.exit()

main()
def tenka18beg_c():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    A_desc = sorted(A, reverse=True)

    if N % 2 == 1:
        tot1, tot2 = 0, 0
        for i, a in enumerate(A_desc):
            if i < N//2 - 1:
                tot1 += 2*a
                tot2 += 2*a
            elif i == N//2 - 1:
                tot1 += a
                tot2 += 2*a
            elif i == N//2:
                tot1 += a
                tot2 -= a
            elif i == N//2 + 1:
                tot1 -= 2*a
                tot2 -= a
            elif N//2 + 1 < i:
                tot1 -= 2*a
                tot2 -= 2*a
        ans = max(ans, max(tot1, tot2))
    else:
        tot = 0
        for i, a in enumerate(A_desc):
            if i < N//2 - 1:
                tot += 2*a
            elif i == N//2 - 1:
                tot += a
            elif i == N//2:
                tot -= a
            elif N//2 < i:
                tot -= 2*a
        ans = tot
    print(ans)

tenka18beg_c()

### FIXED CODE ###

def tenka18beg_c():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    A_desc = sorted(A, reverse=True)

    if N % 2 == 1:
        tot1, tot2 = 0, 0
        for i, a in enumerate(A_desc):
            if i < N//2 - 1:
                tot1 += 2*a
                tot2 += 2*a
            elif i == N//2 - 1:
                tot1 += a
                tot2 += 2*a
            elif i == N//2:
                tot1 += a
                tot2 -= a
            elif i == N//2 + 1:
                tot1 -= 2*a
                tot2 -= a
            elif N//2 + 1 < i:
                tot1 -= 2*a
                tot2 -= 2*a
        ans = max(tot1, tot2)
    else:
        tot = 0
        for i, a in enumerate(A_desc):
            if i < N//2 - 1:
                tot += 2*a
            elif i == N//2 - 1:
                tot += a
            elif i == N//2:
                tot -= a
            elif N//2 < i:
                tot -= 2*a
        ans = tot
    print(ans)

tenka18beg_c()
getList = lambda: list(map(int, input().split()))
a,b,x = getList()
if abs(a - x) < abs(b = x):
  print("A")
else:
  print("B")

### FIXED CODE ###

getList = lambda: list(map(int, input().split()))
x,a,b = getList()
if abs(a - x) < abs(b - x):
  print("A")
else:
  print("B")
n,k = map(int,input().split())
blue = k
red = n-k

from scipy.special import comb


for i in range(1,k+1):
    ans = int( (comb(blue - 1 ,i-1)% (10**9 + 7)) * (comb (red + 1 , i)% (10**9 + 7)))
    print(ans % (10**9 + 7))



### FIXED CODE ###

n,k = map(int,input().split())
blue = k
red = n-k

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result


for i in range(1,k+1):
    if red < i-1 :
        ans = 0
    else:
        ans = int( cmb(blue - 1 ,i-1)* cmb (red + 1 , i))
    print(ans % (10**9 + 7))
N, M = list(map(int, input().split()))
line_list = list()
for _ in range(M):
    a, b = list(map(int, input().split()))
    line_list.append((a, b))

path_points = [ line_list[0][0], line_list[0][1] ]

for i in range(1, M):
    if line_list[i][0] not in path_points and line_list[i][1] not in path_points:
        break

    if   line_list[i][0] in path_points and line_list[i][1] not in path_points:
        path_points.append(line_list[i][1])
    elif line_list[i][1] in path_points and line_list[i][0] not in path_points:
        path_points.insert(0, line_list[i][0])

for point in path_points:
    print(point)



### FIXED CODE ###

import math

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

num_split = 1
sign = None
len_A_list = len(A_list)

for i in range(len_A_list-1):
    if sign == None:
        if A_list[i+1] - A_list[i] == 0:
            continue
        sign = (A_list[i+1] - A_list[i]) / math.fabs(A_list[i+1] - A_list[i])

    if (A_list[i+1] - A_list[i]) *  sign >= 0:
        continue

    num_split += 1
    sign = None

print(num_split)
import math

N = int(input())
T = []

for i in range(N):
    T.append(int(input()))

T.sort
a = T[0]

for i in range(N-1):
    gcd = math.gcd(a, T[i+1])
    a = int(a * T[i+1] / gcd)

print(int(a)) 


### FIXED CODE ###

N = int(input())
T = []

for i in range(N):
    T.append(int(input()))

a = 1

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

for i in range(N):
    a = a * T[i] // gcd(a,T[i])

print(a)
# coding: utf-8
N = int(input())
L0 = 2
L1 = 1
for _ in range(N-1):
    L = L0 + L1
    L0 = L1
    L1 = L
print(L)

### FIXED CODE ###

# coding: utf-8
N = int(input())
L0 = 2
L1 = 1

if N == 1:
    print(L1)
else:
    for _ in range(N-1):
        L = L0 + L1
        L0 = L1
        L1 = L
    print(L)
X = int(input())
A = int(input())
B = int(input())
C = int(input())
cnt = 0
for(i in range(A)):
    for(j in range(B)):
        for(k in range(C)):
            if(i+j+h == X):
                cnt = cnt + 1
print(cnt)

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if (500*i+100*j+50*k) == X:
                cnt = cnt + 1
print(cnt)
n = int(input())
s = [input() for i in range(n)]

status = ["AC","WA","TLE","RE"]

for i in range(len(status)):
    status[i] = len([j for j in s if status[i] in s])

print("AC x {}".format(status[0]))
print("WA x {}".format(status[1]))
print("TLE x {}".format(status[2]))
print("RE x {}".format(status[3]))

### FIXED CODE ###

n = int(input())

change = 1000 - n % 1000
if n % 1000 == 0:
    change = 0
print(change)
n,a=map(int,input().split())

x=list(map(int,input().split()))
A=max(x)
x.insert(0,-1)
dp=[[[0]*(n+1) for _ in range(n*A+1)] for i in range(n+1)]
dp[1][x[1]][1]=1
dp[1][0][0]=1
for i in range(1,n):
    q=x[i+1]
    for s in range(n*A+1):
        for k in range(i+1):
            if s+q<=n*A:
                dp[i+1][s+q][k+1]+=dp[i][s][k]
            dp[i+1][s][k]+=dp[i][s][k]

ans=0
i=1

while i<=n:
    ans+=dp[n][a*(i)][i]
    i+=1
print(ans)




### FIXED CODE ###

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

x=list(map(int,input().split()))
A=max(x)
x.insert(0,-1)
dp=[[[0]*(n+1) for _ in range(n*A+1)] for i in range(n+1)]
dp[1][x[1]][1]=1
dp[1][0][0]=1
for i in range(1,n):
    q=x[i+1]
    for s in range(n*A+1):
        for k in range(i+1):
            if s+q<=n*A:
                dp[i+1][s+q][k+1]+=dp[i][s][k]
            dp[i+1][s][k]+=dp[i][s][k]

ans=0
i=1

while i<=n and a*i<=n*A:
    ans+=dp[n][a*(i)][i]
    i+=1
print(ans)
print('Yes' if eval(input().replace(' ',*))%2 else 'No')

### FIXED CODE ###

print('Yes' if eval(input().replace(' ','*'))%2 else 'No')
str_list = ['dream', 'dreamer', 'erase', 'eraser']
dp = [0] * 100000

for i in range(len(S)):
    for s in str_list:
        if S[i:i+len(s)] == s:
            dp[i+len(s)] = 1

if dp[len(S)] == 1:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

# 確認

S = str(input())
words = ['dream', 'dreamer', 'erase', 'eraser']
dp = [0] * 100010

dp[0] = 1
for i in range(len(S)):
    if not dp[i]:
        continue
    for w in words:
        if S[i:i+len(w)] == w:
            dp[i+len(w)] = 1

if dp[len(S)] == 1:
    print('YES')
else:
    print('NO')
a = list(map(int,input().split()))
a.sort()
k = int(input())
print(a[0]+a[1]+a[2]*(2**k))

### FIXED CODE ###

a,b=map(int,input().split())
print(a if a<=b else a-1)
a,b=[int(x) for x in input().split()]
if a > b :
 print('a > b')
elif a == b :
 print('a == b')
else
 print('a < b')


### FIXED CODE ###

a,b=[int(x) for x in input().split()]
if a > b:
 print('a > b')
elif a == b:
 print('a == b')
else:
 print('a < b')
n, k = (int(i) for in input().split())
print(0) if n % k == 0 else print(1)

### FIXED CODE ###

n, k = (int(i) for i in input().split())
print(0) if n%k == 0 else print(1)
A, B, C, D = map(int, input().split())
max_cnt = B - A + 1
import math
lcm = int(C * D / math.gcd(C, D))
cnt_2 = B//C - (A-1)//C
cnt_3 = B//D - (A-1)//D
cnt_4 = B//lcm - (A-1)//lcm
print(max_cnt - cnt_2 - cnt_3 + cnt_4)

### FIXED CODE ###

A, B, C, D = map(int, input().split())
max_cnt = B - A + 1
import fractions
lcm = int(C * D / fractions.gcd(C, D))
cnt_2 = B//C - (A-1)//C
cnt_3 = B//D - (A-1)//D
cnt_4 = B//lcm - (A-1)//lcm
print(max_cnt - cnt_2 - cnt_3 + cnt_4)
A,B =map(int,input().split())
if A%3 == o or B%3 ==0 or (A+B)%3 ==0:
  print("Possible")
  
else:
  print("Impossible")

### FIXED CODE ###

A,B =map(int,input().split())
if A%3 == 0 or B%3 ==0 or (A+B)%3 ==0:
  print("Possible")
  
else:
  print("Impossible")
L, R = map(int, input().split())

a = R % 2019
b = L % 2019

if a > 2019 // 2:
    a = 2019 - a
if b > 2019 // 2:
    b = 2019 - b

print(a * (a+1) % 2019)


### FIXED CODE ###

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

print(min(N*A, B))
N = int(input())
A=(1,2,3,4,5,6,7,8,9)
B=(1,2,3,4,5,6,7,8,9)
count=0
for a in A:
  for b in B:
    if N/(a*b) == 1 and N%(a*b)==0:
      count=count+1
print(count)
if count>=1:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

A, B = map(int, input().split())
if A >= 10 or B >=10:
  print(-1)
else:
  print(A*B)
from collections import Counter

N = int(input())

A = list(map(int, input().split()))
c = Counter(A)
a = list(set(A))


if len(a) >= 4:
    ans = False

elif len(a) == 3:
    ans = True
    for i in c.values():
        if i != N/3:
            ans = False
            break

elif len(a) == 2:
    a, b = sorted(a)
    if a == 0 and c[a] == N/3 and c[b] == (N/3)*2
        ans = True
    else:
        ans = False

elif len(a) == 1:
    if a == [0]:
        ans = True
    else:
        ans = False

print("Yes" if ans else "No")


### FIXED CODE ###

from collections import Counter

N = int(input())

A = list(map(int, input().split()))
c = Counter(A)
a = list(set(A))


if len(a) >= 4:
    ans = False

elif len(a) == 3:
    a, b, d = a
    if c[a] == c[b] and c[b] == c[d] and a^b == d and d^b == a and a^d == b:
        ans = True
    else:
        ans = False

elif len(a) == 2:
    a, b = sorted(a)
    if a == 0 and c[a] == N/3 and c[b] == (N/3)*2:
        ans = True
    else:
        ans = False

elif len(a) == 1:
    if sum(a) == 0:
        ans = True
    else:
        ans = False

print("Yes" if ans else "No")