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