#include <bits/stdc++.h>
using namespace std;
string sent[10010];
int main() {
  string s;
  int n;
  cin >> n;
  int j = 1;
  while (cin >> s) {
    sent[j] += s;
    sent[j] += " ";
    if (s.find(".") != -1 || s.find("?") != -1 || s.find("!") != -1) j++;
  }
  int sum = 1, tmp = -1;
  for (int i = 1; i < j; i++) {
    if (tmp + sent[i].size() <= n)
      tmp += sent[i].size();
    else if (sent[i].size() > n + 1) {
      cout << "Impossible" << endl;
      return 0;
    } else {
      tmp = sent[i].size() - 1;
      sum++;
    }
  }
  cout << sum << endl;
  return 0;
}
