output_description: Print the number of integers between A and B (inclusive) that can be evenly
  divided by neither C nor D.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      A B C D
attempt: def s0():
      return input()
  
  
  def s1():
      return input().split()
  
  
  def s2(n):
      return [input() for x in range(n)]
  
  
  def s3(n):
      return [input().split() for _ in range(n)]
  
  
  def s4(n):
      return [[x for x in s] for s in s2(n)]
  
  
  def n0():
      return int(input())
  
  
  def n1():
      return [int(x) for x in input().split()]
  
  
  def n2(n):
      return [int(input()) for _ in range(n)]
  
  
  def n3(n):
      return [[int(x) for x in input().split()] for _ in range(n)]
  
  
  def t3(n):
      return [tuple(int(x) for x in input().split()) for _ in range(n)]
  
  
  def p0(b, yes="Yes", no="No"):
      print(yes if b else no)
  
  
  # from sys import setrecursionlimit
  # setrecursionlimit(1000000)
  # from collections import Counter,deque,defaultdict
  # import itertools
  # import math
  # import networkx
  # from bisect import bisect_left,bisect_right
  # from heapq import heapify,heappush,heappop
  # from fractions import gcd
  from math import gcd
  
  
  def lcm(x, y):
      return (x * y) // gcd(x, y)
  
  
  a, b, c, d = n1()
  a1 = b // c
  a2 = (a - 1) // c
  b1 = b // d
  b2 = (a - 1) // d
  l = lcm(c, d)
  c1 = b // l
  c2 = (a - 1) // l
  ans = a1 - a2 + b1 - b2 - c1 + c2
  print(b - a + 1 - ans)
  
problem_description: Statement
  
  You are given four integers A, B, C, and D. Find the number of integers
  between A and B (inclusive) that can be evenly divided by neither C nor D.
samples: [{"input": "4 9 2 3", "output": "2\n    \n\n5 and 7 satisfy the condition.\n\n* * *"}, {"input": "10 40 6 8", "output": "23\n    \n\n* * *"}, {"input": "314159265358979323 846264338327950288 419716939 937510582", "output": "532105071133627368"}]