n = int(input())
la = [int(w) for w in input().split()]+[-1]

money = 1000
kabu = 0

kabu_p = la[0]
cheap_p = kabu_p
bef_trend = -1
for a in la[1:]:
    trend = 1 if a > kabu_p else -1

    if bef_trend*trend == -1 and bef_trend == 1:
        kabu = money//cheap_p
        money += kabu*(kabu_p - cheap_p)
        cheap_p = kabu_p
    else:
        cheap_p = min(cheap_p, a)
    kabu_p = a
    bef_trend = trend
print(money)
