a, b, c, d, e = gets.split.map &:to_i l = (a + b).lcm(c + d) x, y = [0...l, 0...e % l].map { _1.count { |x| x % (a + b) < a && x % (c + d) < c } } puts x * (e / l) + y