#include <bits/stdc++.h>
using namespace std;
int n, cnt = 1;
string s;
int l[1005], num[1005], dp[1005];
int main() {
  cin >> n;
  while (cin >> s) {
    l[cnt] += s.size();
    if (s[s.size() - 1] == '!' || s[s.size() - 1] == '?' ||
        s[s.size() - 1] == '.')
      cnt++;
    else
      l[cnt]++;
  }
  for (int i = 1; i < cnt; i++) num[i] = l[i] + num[i - 1];
  for (int i = 1; i < cnt; i++) dp[i] = 123456789;
  for (int i = 1; i < cnt; i++)
    for (int j = 0; j < i; j++)
      if (num[i] - num[j] + i - j - 1 <= n) dp[i] = min(dp[i], dp[j] + 1);
  if (dp[cnt - 1] < 123456789)
    cout << dp[cnt - 1] << endl;
  else
    cout << "Impossible" << endl;
  return 0;
}
