#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int count = 0;
  int index = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S.at(i) == '.') {
      count++;
      index = i + 1;
    }
  }
  int ans = min(index - count, N - index + count);
  ans = min(ans, N - index + 1);
  cout << ans << endl;
}
