#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
__attribute__((constructor)) void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}
int N;
string S;
int dfs(int i, bool goBlack) {
  if (i == N - 1) {
    if (goBlack) {
      if (S[i] == '#') return 0;
      if (S[i] == '.') return 1;
    } else {
      if (S[i] == '#') return 1;
      if (S[i] == '.') return 0;
    }
  }
  if (goBlack) {
    int cntB = 0;
    for (int j = i; j < N; j++) {
      if (S[j] == '.') cntB++;
    }
    return cntB;
  } else {
    int j;
    bool getBlack = false;
    for (j = i; j < N - 1; j++) {
      if (S[j] == '#') {
        getBlack = true;
        break;
      }
    }
    if (getBlack) {
      int goBlackResult = dfs(j + 1, true);
      int revBlackReslt = 1 + dfs(j + 1, false);
      return min(goBlackResult, revBlackReslt);
    } else {
      return dfs(j, false);
    }
  }
}
int main() {
  cin >> N >> S;
  int result = dfs(0, false);
  cout << result << endl;
}
