#include <bits/stdc++.h>
using namespace std;
int const N = 2e6 + 1;
long long n = 0, a = 0, b, c, k, x, y, z = 0, m = 0, mod = 1e9 + 7, sum1 = 0,
          sum2 = 0, ans = 0, mx = 0;
string s, q;
multiset<int> se;
set<int> ss;
multiset<int>::iterator it;
vector<long long> v, g;
map<int, int> mp;
bool vis[N];
int arr[N];
int main() {
  cin >> n >> k >> m;
  for (int i = 0; i < k; i++) {
    cin >> x;
    g.push_back(x);
    sum1 += x;
    mp[x] += n;
  }
  sort(g.begin(), g.end());
  a = m;
  for (int i = 0; i <= n; i++) {
    a = m;
    if (i * sum1 > m) continue;
    for (int j = 0; j < k; j++) {
      mp[g[j]] -= i;
    }
    sum2 = i * k + i;
    a -= (i * sum1);
    for (int il = 0; il < k; il++) {
      while (a >= g[il] && mp[g[il]] > 0) {
        mp[g[il]]--;
        a -= g[il];
        sum2++;
      }
      if (a < g[il]) break;
    }
    ans = max(ans, sum2);
    for (int j = 0; j < k; j++) {
      mp[g[j]] += n;
    }
  }
  cout << ans << endl;
  return 0;
}
