#include <bits/stdc++.h>
using namespace std;
int white[200010];
long long dp[50][2] = {0};
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  int left = 0, right = n - 1, num = 0, ans = n;
  white[0] = 0;
  for (int i = 0; i < n; i++) {
    white[i + 1] = white[i];
    if (s[i] == '.') white[i + 1]++;
  }
  for (int i = 0; i < n; i++) {
    ans = min(ans, (i + 1 - white[i + 1]) + (white[n] - white[i + 1]));
  }
  cout << ans << endl;
}
