#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  vector<string> v;
  while (cin >> s) v.push_back(s);
  vector<string> arr;
  int ind = 0;
  arr.push_back("");
  for (int i = 0; i < v.size(); i++) {
    arr[ind] += v[i] + " ";
    if (v[i][v[i].size() - 1] == '.' || v[i][v[i].size() - 1] == '!' ||
        v[i][v[i].size() - 1] == '?') {
      ind++;
      arr.push_back("");
    }
  }
  int cur = 0;
  int res = 0;
  for (int i = 0; i < ind; i++) {
    if (arr[i].size() - 1 > n) {
      cout << "Impossible\n";
      return 0;
    }
    if (cur == 0) {
      res++;
      cur += arr[i].size() - 1;
      continue;
    }
    if (cur + arr[i].size() > n) {
      res++;
      cur = arr[i].size() - 1;
    } else {
      cur += arr[i].size();
    }
  }
  cout << res << endl;
  return 0;
}
