{-
A_i周期で食べる人がN日目までに消費する個数：
(div (N-1) A_i)+1
-}

solver::[Int]->Int->Int->Int
solver peris rest day = rest + (sum (map (person_eat day) peris))
            where person_eat::Int->Int->Int
                  person_eat d period = (div (d-1) period)+1

main::IO()
main=do
  nc<-getLine
  let n = read nc
  dxc<-getLine
  let d:x:[]=map read (words dxc)
  peris<-n_get n
  print (solver peris x d)

n_get::Int->IO [Int]
n_get 0 = return []
n_get n = do
  d<-getLine
  let i = read d
  rest<-n_get (n-1)
  return (i:rest)