#include <bits/stdc++.h>
using namespace std;
int k, ans = 0;
string adv;
vector<int> dist;
void read() {
  cin >> k;
  cin.ignore();
  getline(cin, adv);
  dist.resize(adv.length());
  dist[0] = 0;
  for (int i = 1; i < dist.size(); i++) {
    if (adv[i] == '-' || adv[i] == ' ')
      dist[i + 1] = i + 1, dist[i] = dist[i - 1];
    else
      dist[i + 1] = dist[i];
  }
}
bool try_dist(int jump) {
  int stick = k, cur = 0;
  while (stick > 0) {
    cur += jump;
    if (cur > dist.size() - 1) break;
    cur = dist[cur];
    stick--;
  }
  if (cur >= adv.length())
    return true;
  else
    return false;
}
void start_binary() {
  int tl = 0, tr = adv.length() - 1, tm;
  while (tl <= tr) {
    tm = (tl + tr) / 2;
    if (try_dist(tm))
      tr = tm - 1;
    else
      tl = tm + 1;
  }
  if (k == 1)
    cout << adv.length();
  else if (adv.length() == 1)
    cout << 1;
  else if (try_dist(tm))
    cout << tm;
  else
    cout << tm + 1;
}
int main() {
  read();
  start_binary();
  return 0;
}
