#include <bits/stdc++.h>
using namespace std;
int n, ans;
string st;
int main() {
  cin >> n;
  getline(cin, st);
  ans = 0;
  int nowlen = 0, space = 0;
  while (getline(cin, st)) {
    while (st.length() > 0) {
      while (st.length() > 0 && st[0] == ' ') {
        st.erase(0, 1);
        if (nowlen != 0) space++;
      }
      int now = 0, len = 0;
      while (st.length() > 0 && st[now] != '.' && st[now] != '?' &&
             st[now] != '!')
        ++now;
      if (now + 1 > n) {
        cout << "Impossible" << endl;
        return 0;
      }
      st.erase(0, now + 1);
      if (nowlen + now + 1 + space <= n) {
        if (nowlen != 0) nowlen += space;
        nowlen += now + 1;
        space = 0;
      } else {
        nowlen = now + 1;
        ++ans;
        space = 0;
      }
    }
  }
  if (nowlen != 0) ++ans;
  cout << ans << endl;
  return 0;
}
