#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int count = 0;
  int A = 0;
  int B = N - 1;
  while (B - A >= 1) {
    if (S.at(A) == '#' && S.at(B) == '.') {
      if (B - A == 1) {
        count++;
        cout << count << endl;
        return 0;
      } else {
        count += 2;
        A++;
        B--;
      }
    } else if (S.at(A) == '.') {
      A++;
    } else if (S.at(B) == '#') {
      B--;
    }
  }
  cout << count << endl;
}
