#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  deque<char> que;
  for (int i = 0; i < (int)(n); i++) {
    que.push_back(str[i]);
  }
  while (que.front() == '.') {
    que.pop_front();
  }
  while (que.back() == '#') {
    que.pop_back();
  }
  int black = 0;
  int white = 0;
  while (!que.empty()) {
    if (que.front() == '.')
      white++;
    else
      black++;
    que.pop_front();
  }
  cout << min(black, white);
  return 0;
}
