#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  vector<int> count{0};
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '.' && S[i + 1] == '#') {
      int tmp = 0;
      for (int j = 0; j < i; j++) {
        if (S[j] == '#') {
          tmp++;
        }
      }
      for (int j = i + 1; j < N; j++) {
        if (S[j] == '.') {
          tmp++;
        }
      }
      count.push_back(tmp);
    }
  }
  cout << *max_element(count.begin(), count.end());
}
