def main():
    import copy
    n = int(input())
    a = list(map(int,input().split()))
    ans = 1000
    for i in range(n-1):
        ls = [0 for i in range(n)]
        ls[i] = 1
        l = i
        m = 1000
        for j in range(i+1,n):
            if a[l]<a[j]:
                if ls[l]==1:
                    ls[j] = -1
                    l = j
            elif a[l]>a[j]:
                if ls[l]==-1:
                    ls[j] = 1
                    l = j
        for k in range(n):
            if ls[k]==1:
                cnt = m//a[k]
                m = m-cnt*a[k]
            elif ls[k]==-1:
                m += cnt*a[k]
                cnt = 0
        if cnt!=0:
            m+=cnt*a[-1]
        if m>ans:
            ans = m
    print(ans)


if __name__ == "__main__":
    main()
