#include <bits/stdc++.h>
using namespace std;
int main() {
  char c;
  int s[10005];
  int d[10005];
  int scol = 0;
  int i, j, k, l, n;
  scanf("%i", &n);
  scanf("%i", &c);
  i = 0;
  s[0] = 0;
  while (scanf("%c", &c) == 1 && c != 10 && c != 13) {
    if (c == '.' || c == '!' || c == '?') {
      s[scol]++;
      scol++;
      s[scol] = -1;
    } else {
      s[scol]++;
    }
    i++;
  }
  for (i = 0; i < scol; i++) {
    if (s[i] > n) {
      cout << "Impossible";
      return 0;
    }
  }
  d[0] = 1;
  int templen;
  for (i = 1; i < scol; i++) {
    d[i] = 100005;
    templen = s[i];
    for (j = i - 1; j >= 0 && templen + 1 + s[j] <= n; j--) {
      templen += 1 + s[j];
      if (j > 0) {
        d[i] = min(d[i], d[j - 1] + 1);
      } else {
        d[i] = min(d[i], 1);
      }
    }
    d[i] = min(d[i], d[i - 1] + 1);
  }
  cout << d[scol - 1];
  return 0;
}
