#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  string T = S;
  string a;
  string b;
  string c = S.substr(0, 1);
  vector<int> cou(2, 0);
  vector<int> coun(N, 0);
  vector<int> cous(N, 0);
  int t = 0;
  int s = 0;
  for (int i = 1; i < N; i++) {
    if (c == "#") {
      if (cou[0] == 0) {
        cou[0] += 1;
      }
      a = S.substr(i, 1);
      if (a == "#") {
        cou[0] += 1;
      } else {
        if (i == N - 1) {
          cous[s] += 1;
        }
        coun[t] = cou[0];
        t++;
        c = S.substr(i, 1);
      }
    } else {
      if (cou[1] == 0) {
        cou[1] += 1;
      }
      a = S.substr(i, 1);
      if (a == ".") {
        cou[1] += 1;
      } else {
        cous[s] = cou[1];
        s++;
        c = S.substr(i, 1);
      }
    }
  }
  int ansA = coun[0];
  int ansB = cous[0];
  for (int i = 1; i < N; i++) {
    if (ansA == 0) {
      break;
    } else {
      if (coun[i] != 0) {
        ansA += coun[i];
      }
    }
  }
  for (int i = 1; i < N; i++) {
    if (ansB == 0) {
      break;
    } else {
      if (cous[i] != 0) {
        ansB += cous[i];
      }
    }
  }
  if (ansA < ansB) {
    cout << ansA << endl;
  } else {
    cout << ansB << endl;
  }
}
