#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  string s = S;
  s.erase(unique(s.begin(), s.end()), s.end());
  if (s.size() == 1) return cout << 0 << "\n", 0;
  if (s == ".#") return cout << 0 << "\n", 0;
  vector<int> W(N + 1);
  for (int i = 0, cnt = 0; i < N; i++) {
    if (S.at(i) == '.') cnt++;
    W.at(i + 1) = cnt;
  }
  vector<int> B(N + 1);
  for (int i = 0, cnt = 0; i < N; i++) {
    if (S.at(i) == '#') cnt++;
    B.at(i + 1) = cnt;
  }
  int ans = 1e9;
  for (int i = 1; i < N + 1; i++) {
    int w = W.at(N) - W.at(i);
    int b = B.at(i);
    ans = min(ans, w + b);
  }
  cout << ans << "\n";
}
