Harryxun/stf_run huggingface dataset:
*l=map(int,open(0))
while len(l)==0:
	ans=max(ans,max(l))
	l.remove(max(l))
	map(lambda x:x+10,l)
print(ans)

### FIXED CODE ###

l=sorted(list(map(int,open(0))),key=lambda x:-x%10)
print(sum([i+(-i%10) for i in l[:4]])+l[4])
N=int(input())
X=list(map(int, input().split()))

median=(N//2)-1
for i in range (N):
    X_instant=copy.deepcopy(X)
    X_instant.pop(i)
    X_instant.sort()
    output=X_instant[median]
    print(output)

### FIXED CODE ###

N=int(input())
X=list(map(int, input().split()))
 
import copy
X_sort=copy.deepcopy(X)
X_sort.sort()
X_sort
 
median_control=(X_sort[N//2-1]+X_sort[N//2])/2
for i in range (N):
    if X[i]>median_control:
        print (X_sort[N//2-1])
    if X[i]<=median_control:
        print (X_sort[N//2])
a,b,c = input()

if (a == b)  & (b == c) &(c == a):
    print('yes')
else :
    print( 'no')

### FIXED CODE ###

a,b,c = input().split()

if (a == b)  & (b == c) &(c == a):
    print('Yes')
else :
    print( 'No')
ls=[]
for i in range(3):
    ls1=list(map(int,input().split()))
    ls.append(list(ls1))
    ls1.clear()
print(ls)
N=int(input())
for i in range(N):
    b = int(input())
    for j in range(3):
        for l in range(3):
        if ls[l][j] == b:
            ls[l][j] = -1
for i in range(3):
    if ls[i][0] == ls[i][1] == ls[i][2] == -1:
        print("Yes")
        break
    elif ls[0][i] == ls[1][i] == ls[2][i] == -1:
        print("Yes")
        break
    elif ls[0][0] == ls[1][1] == ls[2][2] == -1:
        print("Yes")
        break
    elif ls[0][2] == ls[1][1] == ls[2][0] == -1:
        print("Yes")
        break
    print("No")


### FIXED CODE ###

ls=[]
for i in range(3):
    ls1=list(map(int,input().split()))
    ls.append(list(ls1))
    ls1.clear()
#print(ls)
N=int(input())
for i in range(N):
    b = int(input())
    for j in range(3):
        for l in range(3):
            if ls[l][j] == b:
                ls[l][j] = -1
flg = False
for i in range(3):
    if ls[i][0] == ls[i][1] == ls[i][2] == -1:
        print("Yes")
        flg = True
        break
    elif ls[0][i] == ls[1][i] == ls[2][i] == -1:
        print("Yes")
        flg = True
        break
    elif ls[0][0] == ls[1][1] == ls[2][2] == -1:
        print("Yes")
        flg = True
        break
    elif ls[0][2] == ls[1][1] == ls[2][0] == -1:
        print("Yes")
        flg = True
        break
if flg == False:
    print("No")
import sys

sys.setrecursionlimit(100000)

N, M = map(int, input().split())
A = []

for _ in range(M):
    a = int(input())
    A.append(a)

# d = {}


def f(x):
    print(d)
    if x in A:
        return 0
    if x > N:
        return 0
    if x == N:
        return 1

    if d.get(x):
        return d[x]

    if d.get(x + 1):
        x1 = d.get(x + 1)
    else:
        x1 = f(x + 1)
        d[x + 1] = x1

    if d.get(x + 2):
        x2 = d.get(x + 2)
    else:
        x2 = f(x + 2)
        d[x + 2] = x2

    ans = x1 + x2
    # ans = f(x + 1) + f(x + 2)
    d[x] = ans
    return ans


print(f(0) % 1000000007)


### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)

N, M = map(int, input().split())
A = []
ANS = []
for i in range(N + 10):
    ANS.append(None)

for _ in range(M):
    a = int(input())
    A.append(a)
    ANS[a] = 0


def f(x):
    # print(ANS)
    # if x in A:
    #     print('::::', x)
    #     d[x] = 0
    #     return 0
    if ANS[x] is not None:
        return ANS[x]

    if x > N:
        return 0
    if x == N:
        return 1

    # if d.get(x + 1):
    #     x1 = d.get(x + 1)
    # else:
    #     x1 = f(x + 1)
    #     d[x + 1] = x1
    #
    # if d.get(x + 2):
    #     x2 = d.get(x + 2)
    # else:
    #     x2 = f(x + 2)
    #     d[x + 2] = x2

    # ans = x1 + x2
    ans = f(x + 1) + f(x + 2)
    ANS[x] = ans
    return ans


print(f(0) % 1000000007)
week = {'SUN':7, 'MUN':6, 'TUE':5, 'WED':4, 'THU':3, 'FRI':2, 'SAT':1}
print(week[input()])

### FIXED CODE ###

week = { 'SUN': 7, 'MON': 6, 'TUE': 5, 'WED': 4, 'THU': 3, 'FRI': 2, 'SAT': 1 }
print(week[input()])
import sys
from fractions import Fraction
from collections import Counter

def solve(N, m):
    AB_fr = []
    for a, b in zip(m, m):
        if (a, b) != (0, 0):
            AB_fr.append(Fraction(a, b))
    if len(AB_fr) == 0:
        return 1
    ans = 1
    mod = 10**9+7
    Cnt = Counter(AB_fr)
    for ab_fr, cnt in Cnt.items():
        cnt2 = Cnt[-1/ab_fr]
        if ab_fr < 0 and cnt2 > 0:
            continue
        p = pow(2, cnt, mod)
        p2 = pow(2, cnt2, mod)
        ans = ans * (p + p2 - 1) % mod
    return (ans - 1) % mod

def main():
    N = int(sys.stdin.buffer.readline())
    m = map(int, sys.stdin.buffer.read().split())
    ans = solve(N, m)
    print(ans)

main()


### FIXED CODE ###

def numba_compile(numba_config):
    import os, sys
    if sys.argv[-1] == "ONLINE_JUDGE":
        from numba import njit
        from numba.pycc import CC
        cc = CC("my_module")
        for func, signature in numba_config:
            globals()[func.__name__] = njit(signature)(func)
            cc.export(func.__name__, signature)(func)
        cc.compile()
        exit()
    elif os.name == "posix":
        exec(f"from my_module import {','.join(func.__name__ for func, _ in numba_config)}")
        for func, _ in numba_config:
            globals()[func.__name__] = vars()[func.__name__]
    else:
        from numba import njit
        for func, signature in numba_config:
            globals()[func.__name__] = njit(signature, cache=True)(func)
        print("compiled!", file=sys.stderr)

import sys
import numpy as np
from math import gcd
mod = 10**9+7
def pow_mod(base, exp):  # [pow_mod, "i8(i8,i8)"],
    # mod はグローバル変数を参照
    exp %= mod - 1
    res = 1
    while exp:
        if exp % 2:
            res = res * base % mod
        base = base * base % mod
        exp //= 2
    return res

def solve(N, AB):
    n = 0
    na = nb = nab = 0
    Cnt = {}
    for a, b in zip(AB[::2], AB[1::2]):
        if (a, b) == (0, 0):
            nab += 1
        elif a == 0:
            na += 1
        elif b == 0:
            nb += 1
        else:
            if b < 0:
                a, b = -a, -b
            g = gcd(a, b)
            a //= g
            b //= g
            ab_fr = (a, b)
            n += 1
            if ab_fr in Cnt:
                Cnt[ab_fr] += 1
            else:
                Cnt[ab_fr] = 1
            inv = (-b, a) if a > 0 else (b, -a)
            if inv not in Cnt:
                Cnt[inv] = 0
    ans = (pow_mod(2, na) + pow_mod(2, nb) - 1) % mod
    A = []
    for ab_fr, cnt in Cnt.items():
        a, b = ab_fr
        inv = (-b, a) if a > 0 else (b, -a)
        cnt2 = Cnt[inv]
        p = pow_mod(2, cnt)
        p2 = pow_mod(2, cnt2)
        A.append((p + p2 - 1) % mod)
    A.sort()
    for a in A[::2]:
        ans = ans * a % mod
    ans += nab - 1
    return ans % mod

numba_compile([
    [pow_mod, "i8(i8,i8)"],
    [solve, "i8(i8,i8[:])"],
])

def main():
    N = int(sys.stdin.buffer.readline())
    m = np.array(sys.stdin.buffer.read().split(), dtype=np.int64)
    ans = solve(N, m)
    print(ans)

main()
while True:
    [a,b,c]=[x for x in input().split()]
    a,b=int(a),int(b)
    if a==0 and b==0:
        break
    elif op=="+":
        print(a+b)
    elif op=="-":
        print(a-b)
    elif op=="*":
        print(a*b)
    else:
        print(a//b)

### FIXED CODE ###

n=int(input())
record=[[[0 for r in range(10)] for f in range(3)] for b in range(4)]
for i in range(n):
    b,f,r,v=[int(x) for x in input().split()]
    record[b-1][f-1][r-1]+=v
for b in range(4):
    for f in record[b]:
        print(" "+" ".join([str(x) for x in f]))
    if b!=3:
        print("".join(["#" for x in range(20)]))
n, m = map(int(input().split()))
h = list(map(int, input().split()))
p = [1]*n
max = 0
for i in range(m):
    a, b = map(int(input().split()))
    if h[a-1] <= h[b-1]:
        p[a-1] = 0
    if h[a-1] >= h[b-1]:
        p[b-1] = 0
print(sum(p))

### FIXED CODE ###

n, m = map(int, (input().split()))
h = list(map(int, input().split()))
p = [1]*n
max = 0
for i in range(m):
    a, b = map(int, (input().split()))
    if h[a-1] <= h[b-1]:
        p[a-1] = 0
    if h[a-1] >= h[b-1]:
        p[b-1] = 0
print(sum(p))
def main():
    n,m = map(int, input().split())
    ans = [0] * n
    chg = [0] * n
    flg = 0
    for i in range(m):
        j,k = map(int, input().split())
        if chg[j-1] == 1 and ans[j-1] != k:
            flg = -1
        elif ans[j-1] == 0:
            ans[j-1] = k
            chg[j-1] = 1
    if flg == -1:
        print(flg)
    elif ans[0] == 0:
        print(-1)
    else:
        print(ans[0],ans[1],ans[2],sep="")

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n,m = map(int, input().split())
    ans = [0] * n
    chg = [0] * n
    flg = 0
    for i in range(m):
        j,k = map(int, input().split())
        if chg[j-1] == 1 and ans[j-1] != k:
            flg = -1
        elif ans[j-1] == 0:
            ans[j-1] = k
            chg[j-1] = 1
    if flg == -1:
        print(flg)
    elif len(ans) >= 2 and ans[0] == 0:
        if chg[0] == 0:
            ans[0] = 1
            if n == 3:
                print(ans[0], ans[1], ans[2], sep="")
            elif n == 2:
                print(ans[0], ans[1], sep="")
        else:
            print(-1)
    else:
        if n == 3:
            print(ans[0],ans[1],ans[2],sep="")
        elif n == 2:
            print(ans[0],ans[1],sep="")
        else:
            print(ans[0])


if __name__ == '__main__':
    main()
N,K = map(int,input().split())
S = list(input())

if len(S) == 1:
    print(1)
elif len(S) == 2:
    print(2)
elif S[0] == '0':
    LA = [0]
    LB = [0]
    for i in range(1,N-1):
        if (S[i] != S[i+1]) & (S[i] == '0'):
            LA.append(i+1)
        elif (S[i] != S[i+1]) & (S[i] == '1'):
            LB.append(i)
    LB.append(N-1)
    ANS = 0
    if K > len(LB)-1:
        print(len(S))
    else:
        for i in range(len(LA)-K):
            J = LB[i+K]-LA[i]+1
            if J > ANS:
                ANS = J
        print(ANS)
else:
    LA = [0]
    LB = []
    for i in range(1,N-1):
        if (S[i] != S[i+1]) & (S[i] == '0'):
            LA.append(i+1)
        elif (S[i] != S[i+1]) & (S[i] == '1'):
            LB.append(i)
    LB.append(N-1)
    ANS = 0
    if K > len(LB)-1:
        print(len(S))
    else:
        for i in range(len(LA)-K):
            J = LB[i+K]-LA[i]+1
            if J > ANS:
                ANS = J
        print(ANS)

### FIXED CODE ###

N,K = map(int,input().split())
S = list(input())

if len(S) == 1:
    print(1)
elif len(S) == 2:
    print(2)
elif S[0] == '0':
    LA = [0]
    LB = [0]
    for i in range(0,N-1):
        if (S[i] != S[i+1]) & (S[i] == '0'):
            LA.append(i+1)
    for i in range(1,N-1):
        if (S[i] != S[i+1]) & (S[i] == '1'):
            LB.append(i)
    LB.append(N-1)
    ANS = 0
    if K >= len(LB)-1:
        print(N)
    else:
        for i in range(len(LB)-K):
            J = LB[i+K]-LA[i]+1
            if J > ANS:
                ANS = J
        print(ANS)
else:
    LA = [0]
    LB = []
    for i in range(0,N-1):
        if (S[i] != S[i+1]) & (S[i] == '0'):
            LA.append(i+1)
        elif (S[i] != S[i+1]) & (S[i] == '1'):
            LB.append(i)
    LB.append(N-1)
    ANS = 0
    if K >= len(LB)-1:
        print(N)
    else:
        for i in range(len(LB)-K):
            J = LB[i+K]-LA[i]+1
            if J > ANS:
                ANS = J
        print(ANS)
import sys;input=sys.stdin.readline

def main():
    n,q=map(int,input().split())
    event=[]
    stop=set()
    for i in range(n):
        s,t,x=map(int,input().split())
        event.append((s-x,x))
        event.append((t-x,-x))
    for i in range(q):
        event.append((int(input()),"q"))
    
    event.sort(key=lambda x:x[0])
    ans=[]
    minstop=float("inf")
    for t,x in event:
        if type(x)==str:
            ans.append(str(minstop))
        elif x>=0:
            stop.add(x)
        elif x<0 and len(stop)>0:
            stop.remove(-x)
        if minstop!=x:
            minstop=min(stop or [-1])
    print("\n".join(ans))
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys;input=sys.stdin.readline

n,q=map(int, input().split())
event=[]
for _ in range(n):
    s,t,x=map(int,input().split())
    event.append((s-x-0.5,1,x))
    event.append((t-x-0.5,-1,x))
for i in range(q):
    event.append((int(input()),0,i))
    
event.sort()
is_stop=False
stop=set()
minstop=float('inf')
ans=[-1]*q
for t,e,x in event:
    if e > 0:
        stop.add(x)
        if x<minstop:
            minstop=x
            is_stop=True
    elif e<0:
        stop.remove(x)
        if minstop==x:
            is_stop=False
    elif len(stop)>0:
        if not is_stop:
             minstop=min(stop)
             is_stop=True
        ans[x]=minstop
        
print('\n'.join(map(str, ans)))
# -*- coding: utf-8 -*-
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
seen = [[False for __ in range(w)] for _ in range(h)]
dx = [-1, 1, 0, 0]
dy = [0, 0, -1, 1]
black_count = 0
white_count = 0


def dfs(x: int, y: int):
    global black_count, white_count

    if s[x][y] == '#':
        black_count += 1
    else:
        white_count += 1

    seen[x][y] = True

    for k in range(4):
        next_x = x + dx[k]
        next_y = y + dy[k]

        if 0 <= next_x < h and 0 <= next_y < w:
            if s[x][y] != s[next_x][next_y] and not seen[next_x][next_y]:
                dfs(next_x, next_y)


def main():
    global black_count, white_count
    ans = 0

    # See:
    # http://drken1215.hatenablog.com/entry/2019/01/13/035500
    for i in range(h):
        for j in range(w):
            if s[i][j] == '#' and not seen[i][j]:
                black_count = 0
                white_count = 0
                dfs(i, j)
                ans += black_count * white_count

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
seen = [[False for __ in range(w)] for _ in range(h)]
dx = [-1, 1, 0, 0]
dy = [0, 0, -1, 1]
black_count = 0
white_count = 0


def dfs(x: int, y: int):
    global black_count, white_count

    if s[x][y] == '#':
        black_count += 1
    else:
        white_count += 1

    seen[x][y] = True

    for k in range(4):
        next_x = x + dx[k]
        next_y = y + dy[k]

        if 0 <= next_x < h and 0 <= next_y < w:
            if s[x][y] != s[next_x][next_y] and not seen[next_x][next_y]:
                dfs(next_x, next_y)


def main():
    from sys import setrecursionlimit
    setrecursionlimit(200000)

    global black_count, white_count
    ans = 0

    # See:
    # http://drken1215.hatenablog.com/entry/2019/01/13/035500
    for i in range(h):
        for j in range(w):
            if s[i][j] == '#' and not seen[i][j]:
                black_count = 0
                white_count = 0
                dfs(i, j)
                ans += black_count * white_count

    print(ans)


if __name__ == '__main__':
    main()
a, b, c, d = input()
o = "+-"
for i in range(2 ** 3):
    s = a + o[i & 1] + b + o[i & 2] + c + o[i & 4] + d
    if eval(s) == 7:
        print(s + "=7")
        break

### FIXED CODE ###

a = [int(x) for x in list(input())]
op = 3
ops = [0] * op
for i in range(2 ** op):
    result = a[0]
    bry = list(format(i, "0{}b".format(op)))
    for index, value in enumerate(bry):
        if value == "1":
            result += a[index + 1]
            ops[index] = "+"
        else:
            result -= a[index + 1]
            ops[index] = "-"
    if result == 7:
        ans = str(a[0])
        for j in range(3):
            ans += "{}{}".format(ops[j], a[j+1])
        ans += "=7"
        print(ans)
        break
for i in range(10**8):
	for j in range(-10**4,10**4):
    	if i**5 - j **5 :
      		print(i.j)
      		break

### FIXED CODE ###

n = int(input())
flag = False
for i in range(10**8):
    for j in range(-10**4,10**4):
        if i**5 - j **5 == n :
            print(i,j)
            flag = True
            break
    if flag == True :
        break
import collections
import sys

sys.setrecursionlimit(10 ** 6)

N = int(input())
colors = [int(x) - 1 for x in input().split()]
neighbors = collections.defaultdict(list)
for i in range(N - 1):
    a, b = map(int, input().split())
    neighbors[a - 1].append(b - 1)
    neighbors[b - 1].append(a - 1)

subtree_sizes = [0] * N


def calc_sizes(node, parent):
    sz = 1
    for i in neighbors[node]:
        if i != parent:
            sz += calc_sizes(i, node)
    subtree_sizes[node] = sz
    return sz


calc_sizes(0, -1)
components = {c: [N] for c in range(N)}
components[colors[0]] = [0]


def calc_components(node, parent, color_component):
    if parent >= 0 and colors[parent] != colors[node]:
        color_component[colors[parent]] += 1
        components[colors[parent]].append(subtree_sizes[node])
        components[colors[node]][color_component[colors[node]]] -= subtree_sizes[node]
    for i in neighbors[node]:
        if i != parent:
            calc_components(i, node, color_component)
    if parent >= 0 and colors[parent] != colors[node]:
        color_component[colors[node]] -= 1


calc_components(0, -1, {c: 0 for c in colors})


def count_paths(n):
    return n * (n + 1) // 2


total_paths = count_paths(subtree_sizes[0])
for c in range(N):
    print(total_paths - sum(count_paths(size) for size in components[c]))


### FIXED CODE ###

import collections
import sys

sys.setrecursionlimit(10 ** 6)

N = int(input())
colors = [int(x) - 1 for x in input().split()]
neighbors = collections.defaultdict(list)
for i in range(N - 1):
    a, b = map(int, input().split())
    neighbors[a - 1].append(b - 1)
    neighbors[b - 1].append(a - 1)

subtree_sizes = [0] * N


def calc_sizes(node, parent):
    sz = 1
    for i in neighbors[node]:
        if i != parent:
            sz += calc_sizes(i, node)
    subtree_sizes[node] = sz
    return sz


calc_sizes(0, -1)
components = {c: {0: N} for c in range(N)}
components[colors[0]] = {}
color_stack = {c: [0] for c in range(N)}
color_stack[colors[0]] = []


def calc_components(node, parent):
    color_stack_pushed = False
    if parent >= 0 and colors[parent] != colors[node]:
        color_parent = color_stack[colors[node]][-1]
        components[colors[node]][color_parent] -= subtree_sizes[node]
        components[colors[parent]][node] = subtree_sizes[node]
        color_stack[colors[parent]].append(node)
        color_stack_pushed = True
    for i in neighbors[node]:
        if i != parent:
            calc_components(i, node)
    if color_stack_pushed:
        color_stack[colors[parent]].pop()


calc_components(0, -1)


def count_paths(n):
    return n * (n + 1) // 2


total_paths = count_paths(subtree_sizes[0])
for c in range(N):
    print(total_paths - sum(count_paths(size) for size in components[c].values()))
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

n=II()
s=SI()
p=s.count("1")
p0=p-1
p1=p+1
pw0=[]
pw1=[]
two0=two1=1
for _ in range(n):
    pw0.append(two0)
    pw1.append(two1)
    two0=two0*2%p0
    two1=two1*2%p1

t0=0
t1=0
for i,c in enumerate(s[::-1]):
    if c=="1":
        t0=(t0+pw0[i])%p0
        t1=(t1+pw1[i])%p1

def popcnt(x):
    return bin(x).count("1")

dp0=[-1]*n
def f0(x):
    if x==0:return 0
    if dp0[x]==-1:dp0[x]=f0(x%popcnt(x))+1
    return dp0[x]

ans=[]
for i,c in enumerate(s[::-1]):
    if c=="1":
        cur=(t0-pw0[i])%p0
    else:
        cur=(t1+pw1[i])%p1
    ans.append(f0(cur)+1)

for a in ans[::-1]:print(a)

### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

n=II()
s=SI()
p=s.count("1")
p0=p-1
p1=p+1
pw0=[]
pw1=[]
two0=two1=1
for _ in range(n):
    pw0.append(two0)
    pw1.append(two1)
    if p0>0:two0=two0*2%p0
    two1=two1*2%p1

t0=0
t1=0
for i,c in enumerate(s[::-1]):
    if c=="1":
        if p0>0:t0=(t0+pw0[i])%p0
        t1=(t1+pw1[i])%p1

def popcnt(x):
    return bin(x).count("1")

dp0=[-1]*n
def f0(x):
    if x==0:return 1
    if dp0[x]==-1:dp0[x]=f0(x%popcnt(x))+1
    return dp0[x]

ans=[]
for i,c in enumerate(s[::-1]):
    if p0==0 and c=="1":
        ans.append(0)
        continue
    if c=="1":
        cur=(t0-pw0[i])%p0
    else:
        cur=(t1+pw1[i])%p1
    ans.append(f0(cur))

for a in ans[::-1]:print(a)
s=input()
if s="ABC":
    print("ARC")
else:
    print("ABC")


### FIXED CODE ###

s=input()
if s=="ABC":
    print("ARC")
else:
    print("ABC")
# coding: utf-8


def main():
    R = input(int())
    return R * 2 * 3.1415


print(main())


### FIXED CODE ###

# coding: utf-8


def main():
    R = int(input())
    
    return R * 2 * 3.1415


print(main())
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
#from fractions import gcd
from math import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


a, b, c, d = Is()
def calc(num, x, y):
    l = x*y/gcd(x, y)
    return num - floor(num/x) - floor(num/y) + floor(num/l)

print(calc(b, c, d) - calc(a-1, c, d))


### FIXED CODE ###

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
#from math import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


a, b, c, d = Is()
def calc(num, x, y):
    l = (x*y)//gcd(x, y)
    return num - num//x - num//y + num//l

print(calc(b, c, d) - calc(a-1, c, d))