#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = 1001001001;
  int b = 0, w = 0;
  for (int i = 0; i < (n); ++i) {
    if (s.at(i) == '.') w++;
  }
  for (int i = 0; i < (n); ++i) {
    if (s.at(i) == '.') w--;
    if (s.at(i) == '#') b++;
    ans = min(ans, b + w);
  }
  cout << ans << endl;
  return 0;
}
