#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int count = 0;
  for (char &c : s)
    if (c == '.') count++;
  if (s[0] == '.') {
    count--;
    count = min(count, n - count - 1);
  } else {
    count = min(count, n - count + 1);
  }
  cout << count << endl;
  return 0;
}
