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