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