#include <bits/stdc++.h>
using namespace std;
int count_white_chank(string& s, int index);
int count_black_chank(string& s, int index);
int main(int argc, char* argv[]) {
  int N;
  string S;
  cin >> N;
  cin >> S;
  bool firstblack = false;
  bool firstwhite = false;
  int wCount = 0;
  int bCount = 0;
  int first_bCount = 0;
  int first_wCount = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.' && firstblack == true) {
      wCount++;
      if (firstwhite == false) {
        first_wCount = count_white_chank(S, i);
        firstwhite = true;
      }
    }
    if (S[i] == '#') {
      if (firstblack == false) {
        firstblack = true;
        first_bCount = count_black_chank(S, i);
      }
      bCount++;
    }
  }
  if (bCount > wCount) {
    if (first_wCount > first_bCount) wCount -= (first_wCount - first_bCount);
    cout << wCount << endl;
  } else {
    cout << bCount << endl;
  }
  return 0;
}
int count_black_chank(string& s, int index) {
  int count = 1;
  for (int i = index; i < s.size() - 1; i++) {
    if (s[i + 1] == '#')
      count++;
    else
      break;
    ;
  }
  return count;
}
int count_white_chank(string& s, int index) {
  int count = 1;
  for (int i = index; i < s.size() - 1; i++) {
    if (s[i + 1] == '.') {
      count++;
    } else {
      break;
    }
  }
  return count;
}
