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: A, B, C, D = map(int, input().split())
  
  # 最大公約数を求める
  ans = 0
  tmp1, tmp2 = C, D
  while 1:
      if tmp1 % tmp2 == 0:
          ans = tmp2
          break
      else:
          tmp = tmp1 % tmp2
          tmp1 = tmp2
          tmp2 = tmp
  ans = int(C * D / ans)
  # print(ans)
  
  num1 = B // C
  num2 = (A - 1) // C
  num_C = num1 - num2
  
  num1 = B // D
  num2 = (A - 1) // D
  num_D = num1 - num2
  
  num1 = B // ans
  num2 = (A - 1) // ans
  num_CD = num1 - num2
  
  print(B - A + 1 - num_C - num_D + num_CD)
  
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"}]