n, m = gets.split(" ").map(&:to_i)
a = gets.split(" ").map(&:to_i)
l = []
c = 0
until m < (a[0]*c + a[0]/2) do
  l << a[0]*c + a[0]/2
  c += 1
end
a.delete_at(1)
a.each {|ai|
  l2 =[]
  c2 = 0
  until m < (ai*c2 + ai/2) do
    l2 << ai*c2 + ai/2
    c2 += 1
  end
  l = l & l2
}
print l.uniq.length