#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 5;
const int mo = 1e9 + 7;
long long readint() {
  long long x = 0, f = 1;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    (s = getchar());
  }
  while (s >= '0' && s <= '9') {
    x = (x << 3) + (x << 1) + (s ^ 48);
    (s = getchar());
  }
  return x * f;
}
long long getans(long long x) {
  long long num = x, sigma = 0, last = 0;
  while (num) {
    last = num % 10;
    num /= 10;
    sigma++;
  }
  long long cnt = 1, ans = 0;
  for (long long i = 1; i < sigma; i++) {
    ans += cnt;
    cnt *= 10;
  }
  if (last > 1)
    ans += cnt;
  else if (last == 1)
    ans += x - cnt + 1;
  return ans;
}
double p[maxn];
double dp[maxn];
signed main() {
  long long n = readint();
  for (long long i = 1; i <= n; i++) {
    long long l = readint(), r = readint();
    long long cnt = getans(r) - getans(l - 1);
    p[i] = 1.0 * cnt / (r - l + 1);
  }
  long long k = readint();
  dp[0] = 1.0;
  for (long long i = 1; i <= n; i++) {
    for (long long j = n; j >= 0; j--) {
      dp[j] = dp[j] * (1.0 - p[i]);
      if (j > 0) dp[j] += dp[j - 1] * p[i];
    }
  }
  double ans = 0;
  for (long long i = 0; i <= n; i++) {
    if (i * 100 >= n * k) ans += dp[i];
  }
  printf("%.15f", ans);
  return 0;
}
