#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, m, c = 0, c1 = 0, x = 1, p = 0, z = 0;
  cin >> n >> k >> m;
  int arr[k];
  for (int i = 0; i < k; i++) {
    cin >> arr[i];
    c += arr[i];
    p += arr[i];
    z += arr[i];
  }
  sort(arr, arr + k);
  for (int j = 1; j <= n; j++) {
    if (c * j <= m) {
      c1 += k + 1;
      x = j + 1;
    } else {
      c = c * (x - 1);
      break;
    }
  }
  bool b = 0;
  if (c < m) {
    for (int i = 0; i < k; i++) {
      for (int j = x; j <= n; j++) {
        if (c + arr[i] <= m) {
          c += arr[i];
          c1++;
          if (i == k - 1) {
            c1++;
          }
        } else {
          b = 1;
          break;
        }
      }
      if (b) {
        break;
      }
    }
  }
  int s = 0, s1 = 0;
  b = 0;
  for (int i = 0; i < k; i++) {
    for (int j = 1; j <= n; j++) {
      if (s + arr[i] <= m) {
        s += arr[i];
        s1++;
        if (i == k - 1) {
          s1++;
        }
      } else {
        b = 1;
        break;
      }
    }
    if (b) {
      break;
    }
  }
  int a = 0, a1 = 0, u = 1;
  b = 0;
  for (int i = 0; i < k; i++) {
    for (int j = u; j <= n; j++) {
      if (a + arr[i] <= m) {
        a += arr[i];
        a1++;
        if (i == k - 1) {
          a1++;
        }
      } else {
        b = 1;
        break;
      }
    }
    p -= arr[i];
    if (a + p <= m && p != 0) {
      u++;
      a1 += k - i;
      a += p;
    }
    if (b) {
      break;
    }
  }
  int u1 = 0, v = 0, h = 0, h1 = 0;
  for (int l = 1; l <= n; l++) {
    if (z * l <= m && m != 0 && z != 0) {
      v += k + 1;
      u1++;
      h1 = z * l;
    } else {
      break;
    }
    int b1 = 0, g = 0;
    for (int i = 0; i < k; i++) {
      for (int j = u1 + 1; j <= n; j++) {
        if (h1 + arr[i] <= m) {
          h1 += arr[i];
          g++;
          if (i == k - 1) {
            g++;
          }
        } else {
          b1 = 1;
          break;
        }
      }
      if (b1) {
        break;
      }
    }
    if (v + g > h) {
      h = v + g;
    }
  }
  cout << max(c1, max(a1, max(h, s1))) << endl;
  return 0;
}
