#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, ans, count;
  vector<int> L, R;
  string S;
  cin >> N >> S;
  L[0] = 0;
  R[0] = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] = '.') R[0]++;
  }
  ans = L[0] + R[0];
  for (int i = 1; i <= N; i++) {
    if (S[i] = '#')
      L[i] = L[i - 1] + 1;
    else
      R[i] = R[i - 1] - 1;
    ans = min(ans, L[i] + R[i]);
  }
  cout << ans << endl;
}
