#include <bits/stdc++.h>
using namespace std;
void faster() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const int MAXN = 2e5;
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
long long n, k, T, m, a[MAXN], q[MAXN], ans, t, ans2;
int main() {
  faster();
  cin >> k >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    t += a[i];
  }
  sort(a, a + n);
  for (int i = 0; i <= k; ++i) {
    T = m - i * t;
    long long res = i * (n + 1);
    if (T < 0) continue;
    bool flag = 1;
    for (int j = i + 1; j <= k; ++j) q[j] = 0;
    while (T > 0 && flag) {
      flag = 0;
      for (int j = i + 1; j <= k; ++j) {
        if (q[j] < n && T >= a[q[j]]) {
          T -= a[q[j]++];
          res++;
          flag = 1;
          if (q[j] == n) res++;
        }
      }
    }
    ans = max(ans, res);
  }
  cout << ans;
  return 0;
}
