#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t;
  int n;
  cin >> n;
  while (getline(cin, t)) {
    s += t;
  }
  int i, j, cur, last;
  last = -1;
  cur = -1;
  int res = 1;
  for (i = 0; i < s.size(); ++i) {
    if (i - last > n) {
      if (cur == last) {
        cout << "Impossible" << endl;
        return 0;
      }
      last = ++cur;
      res++;
    }
    if (s[i] == '.' || s[i] == '?' || s[i] == '!') {
      cur = i;
    }
  }
  cout << res << endl;
  return 0;
}
