#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int siro_count = 0;
  int kuro_count = 0;
  int kuro_usiro_count = 0;
  int count = 0;
  int res = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S.at(i) == '.') {
      siro_count++;
    } else {
      kuro_count++;
    }
  }
  if (kuro_count >= siro_count) {
    for (int i = 0; i < S.size(); i++) {
      if (S.at(i) == '.') {
        res++;
      } else {
        break;
      }
    }
    int res2 = res + 1;
    for (int i = res2; i < S.size(); i++) {
      if (S.at(i) == '.') {
        count++;
      }
    }
  } else {
    for (int i = N; i <= 1; i--) {
      if (S.at(i) == '#') {
        kuro_usiro_count++;
      } else {
        break;
      }
    }
    for (int i = 0; i < S.size(); i++) {
      if (S.at(i) == '.') {
        res++;
      } else {
        break;
      }
    }
    for (int i = res; i < S.size(); i++) {
      if (S.at(i) == '#') {
        count++;
      }
    }
    count -= kuro_usiro_count;
  }
  cout << count << endl;
}
