#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  cin >> N;
  string S;
  cin >> S;
  int cnt1[N], cnt2[N];
  cnt1[0] = (S[0] == '#');
  cnt2[N - 1] = (S[N - 1] == '.');
  for (int i = 1; i < N; ++i) {
    cnt1[i] = (S[i] == '#') + cnt1[i - 1];
  }
  for (int i = N - 2; i >= 0; --i) {
    cnt2[i] = (S[i] == '.') + cnt2[i + 1];
  }
  int res = 1e9;
  for (int i = 0; i < N - 1; ++i) {
    res = min(res, cnt1[i] + cnt2[i + 1]);
  }
  res = min({res, cnt1[N - 1]});
  cout << res << "\n";
  return 0;
}
