#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, ans;
  string S;
  cin >> N >> S;
  long long ans1 = 0, ans2 = 0, ans3, t;
  for (long long i = 0; i < N; i++) {
    if (S[i] == '#') ans1++;
  }
  for (long long i = 0; i < N; i++) {
    if (S[i] == '.') ans2++;
  }
  t = ans3 = ans1;
  for (long long i = 0; i < N; i++) {
    if (S[i] == '.') {
      t--;
    } else {
      t++;
    }
    ans3 = min(t, ans3);
  }
  cout << min(min(ans1, ans2), ans3) << endl;
  return 0;
}
