import sys def input(): return sys.stdin.readline().strip() def main(): a, b, c, d = map(int, input().split()) p, q, r, s, t = map(int, input().split()) ans = 0 for x, y in sorted([(p, a), (q, b), (r, c), (s, d)]): z = min(t // x, y) t -= z * x ans += z print(ans) if __name__ == "__main__": main()