#include <bits/stdc++.h>
using namespace std;

using ll = long long;

int main(){
  int N;
  string S;
  cin >> N >> S;

  vector<int> B(N+1, 0);

  for (int i = 0; i < N; i++) {
    if(S[i]=='#') B[i+1] = B[i] + 1;
    else B[i+1] = B[i];
  }

  int ans = 10000000;
  for (int i = 0; i <= N; i++) {
    ans = min(ans, B[i]+((N-i)-(B[N]-B[i])));
  }
  cout << ans << endl;
}
