#include <bits/stdc++.h>

using namespace std;

template<typename T> void drop(const T &x){cout<<x<<'\n';exit(0);}

void milktea() {
  int d, g;
  cin >> d >> g;
  vector<int> p(d), c(d);
  for(int i = 0; i < d; i++) {
    cin >> p[i] >> c[i];
  }
  
  int ans = 1e9;
  for(int bit = 0; bit < (1 << d); bit++) {
    int s = 0, num = 0, m = -1;
    for(int i = 0; i < d; i++) {
      if(bit & 1 << i) {
        s += 100 * (i+1) * p[i] + c[i];
        num += p[i];
      } else {
        m = i;
      }
    }
    cout << '\n';
    if(s < g) {
      int s1 = 100 * (m+1);
      int need = (g - s + s1 - 1) / s1;
      if(need >= p[m]) continue;
      num += need;
    }
    ans = min(ans, num);
  }
  cout << ans << '\n';
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int tt=1;
  //cin >> tt;
  while(tt--) milktea();

  return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main() {
    int64_t N;
    string S;
    cin >> N >> S;

    reverse(S.begin() + N, S.end());

    map<pair<string, string>, int64_t> mp[2];
    for (int64_t i = 0; i < (1LL << N); i++) {
        for (int64_t j = 0; j < 2; j++) {
            string str1, str2;
            for (int64_t k = 0; k < N; k++) {
                if (i & (1LL << k)) {
                    str1 += S[k + N * j];
                } else {
                    str2 += S[k + N * j];
                }
            }

            mp[j][make_pair(str1, str2)]++;
        }
    }

    int64_t ans = 0;
    for (const auto& p : mp[0]) {
        ans += mp[0][p.first] * mp[1][p.first];
    }
    cout << ans << endl;
}