#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n >> s;
  int sum = 0, maxn = n + 1;
  for (int i = 0; i < n; ++i)
    if (s[i] == '.') ++sum;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.')
      --sum;
    else
      ++sum;
    maxn = min(maxn, sum);
  }
  cout << maxn << '\n';
  return 0;
}
