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

int count(string s, vector<char> kouho, int N) {
  int count = 0;
  for (int i = 0; i < N; i++) {
    if (!(s.at(i) == kouho.at(i))) {
      count++;
    }
  }
  return count;
}


int main() {
  int N;
  string S;
  cin >> N >> S;
  
  vector<char> kouho1(N, '.'); //全部白
  vector<char> kouho2(N, '#'); //全部黒
  vector<char> kouho3(N);      //右端だけ黒
  for (int i = 0; i < N; i++) {
    if (i == N-1) {
      kouho3.at(i) = '#';
    }
    else {
      kouho3.at(i) = '.';
    }
  }
  
  cout << min({count(S, kouho1, N), count(S, kouho2, N), count(S, kouho3, N)}) << endl;
}
