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