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