#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string line;
  getline(cin, line);
  getline(cin, line);
  vector<string> sentences;
  int cur = 0;
  while (cur < (int)line.size()) {
    int start = cur;
    while (line[cur] != '.' && line[cur] != '?' && line[cur] != '!') cur++;
    if (line[start] == ' ') start++;
    sentences.push_back(line.substr(start, cur - start + 1));
    cur++;
  }
  const int s = (int)sentences.size();
  bool ok = true;
  for (int i = 0; i < s; i++) {
    if (sentences[i].size() > n) ok = false;
  }
  if (!ok) {
    cout << "Impossible" << endl;
  } else {
    vector<int> best(s);
    best[0] = 1;
    for (int i = 1; i < s; i++) {
      int ret = 1 + best[i - 1];
      int prop = sentences[i].size();
      for (int j = i - 1; j >= 0; j--) {
        prop += 1 + sentences[j].size();
        if (prop <= n)
          ret = min(ret, 1 + (j > 0 ? best[j - 1] : 0));
        else
          break;
      }
      best[i] = ret;
    }
    cout << best[s - 1] << endl;
  }
  return 0;
}
