#include <bits/stdc++.h>
using namespace std;
int n, a = 0, b = 0;
string s;
void Solve() {
  cin >> n >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '#')
      a++;
    else if (s[i] == '.')
      b++;
  }
  if (a == 0 || b == 0)
    cout << 0 << endl;
  else if (a == 1 || b == 1)
    cout << 1 << endl;
  else if (a >= 2 && b >= 2)
    cout << 2 << endl;
}
int main() {
  Solve();
  return 0;
}
