#include <bits/stdc++.h>
using namespace std;
int N;
string S;
int preW[200005];
int preB[200005];
int ans = INT_MAX;
int main() {
  cin >> N >> S;
  for (int i = 1; i <= N; i++) {
    preW[i] = preW[i - 1] + (S[i - 1] == '.' ? 1 : 0);
    preB[i] = preB[i - 1] + (S[i - 1] == '#' ? 1 : 0);
  }
  for (int i = 1; i <= N; i++) ans = min(ans, preB[i] + preW[N] - preW[i]);
  cout << ans;
  return 0;
}
