#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long N, ans = 0;
  string S;
  cin >> N;
  cin >> S;
  vector<long long> siro(N + 1, 0), kuro(N + 1, 0);
  kuro[0] += (S[0] == '#');
  siro[N - 1] += (S[N - 1] == '.');
  for (int(i) = 0; (i) < (N); (i)++) kuro[i] = kuro[i - 1] + (S[i] == '#');
  for (int i = N - 1; i >= 0; i--) siro[i] = siro[i + 1] + (S[i] == '.');
  ans = N;
  for (int(i) = (1); (i) < (N - 1); (i)++) {
    ans = min(ans, kuro[i - 1] + siro[i]);
  }
  ans = min(ans, kuro[N - 1]);
  ans = min(ans, siro[0]);
  cout << ans;
  return 0;
}
