#include <bits/stdc++.h>
using namespace std;
int main() {
  long N;
  string S;
  cin >> N;
  cin >> S;
  vector<bool> isBlack(N);
  vector<bool> isBlack2(N);
  vector<bool> isBlack3(N);
  vector<bool> isBlack4(N);
  for (long i = 0; i < N; i++) {
    isBlack[i] = S[i] == '#';
    isBlack2[i] = S[i] == '#';
    isBlack3[i] = S[i] == '#';
    isBlack4[i] = S[i] == '#';
  }
  long count1 = 0;
  for (long i = 0; i < N - 1; i++) {
    if (isBlack[i] && !isBlack[i + 1]) {
      count1++;
      isBlack[i + 1] = true;
    }
  }
  long count2 = 0;
  for (long i = 0; i < N - 1; i++) {
    if (isBlack2[i] && !isBlack2[i + 1]) {
      count2++;
      isBlack2[i] = false;
    }
  }
  long count3 = 0;
  for (long i = N - 1; i > 0; i--) {
    if (!isBlack3[i] && isBlack3[i - 1]) {
      count3++;
      isBlack3[i] = true;
    }
  }
  long count4 = 0;
  for (long i = N - 1; i > 0; i--) {
    if (!isBlack4[i] && isBlack4[i - 1]) {
      count4++;
      isBlack4[i - 1] = false;
    }
  }
  cout << min(min(min(count1, count2), count3 + 1), count4 + 1) << endl;
  return 0;
}
