#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  string s2 = s;
  int count1 = 0;
  int i = 0;
  for (int j = 0; j < n; ++j) {
    if (s[j] == '.')
      ++i;
    else
      break;
  }
  for (; i < n; ++i) {
    if (s[i] == '.') {
      s[i] = '#';
      ++count1;
    }
  }
  int count2 = 0;
  for (int j = n - 1; j >= 0; --j) {
    if (s2[i] == '#')
      --n;
    else
      break;
  }
  for (int i = 0; i < n - 1; ++i) {
    if (s2[i] == '#') {
      s2[i] = '.';
      ++count2;
    }
  }
  cout << min(count1, count2) << endl;
  return 0;
}
