#include <bits/stdc++.h>
using namespace std;
long long modx(long long Base, long long exponent) {
  long long ans = 1;
  if (Base == 1) return Base;
  while (exponent) {
    if (exponent & 1) ans = (ans * Base) % 1000000007;
    Base = (Base * Base) % 1000000007;
    exponent = exponent >> 1;
  }
  return ans;
}
long long inmodx(long long num) { return (modx(num, 1000000007 - 2LL)); }
bool cmp() {
  bool ans = 0;
  return ans;
}
struct ST_Node {
  ST_Node() { return; }
  void assign_value_(int val) { return; }
  void merge_nodes_(ST_Node& left, ST_Node& right) { return; }
};
const int N = (45) + 9;
const int M = (N << 2) + 9;
const int LOGN = ((int)log2(N)) + 3;
const int LOGM = ((int)log2(M)) + 3;
long long a[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k, i, j, ans = 0, val, cnt;
  long long m, sum = 0LL, temp, x;
  cin >> n >> k >> m;
  for (i = (1); i < (k + 1); i++) cin >> a[i];
  sort(a + 1, a + k + 1);
  for (i = (1); i < (k + 1); i++) sum += a[i];
  temp = 0LL;
  for (i = (0); i < (n + 1); i++) {
    val = 0;
    if (temp > m) break;
    val = i * (k + 1);
    x = m - temp;
    for (j = (1); j < (k + 1); j++) {
      cnt = n - i;
      while (cnt--) {
        if (x < a[j]) break;
        val++;
        x -= a[j];
      }
    }
    ans = max(ans, val);
    temp += sum;
  }
  cout << ans;
  return 0;
}
