#include <bits/stdc++.h>
using namespace std;
int N;
char S[200020];
int Black[100010], White[100010], BlackGroup[100010];
int main() {
  int count = 0;
  cin >> N;
  for (int i = 0; i < N; i++) cin >> S[i];
  int tmpBlack = 0, tmpWhite = 0, tmp;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      if (S[i - 1] != '#') {
        Black[count] = tmpBlack;
        White[count] = tmpWhite;
        count++;
        tmpBlack++;
        tmp = 1;
      } else {
        tmpBlack++;
        tmp++;
      }
      if (i == N - 1) {
        BlackGroup[count - 1] = tmp;
      }
    } else {
      tmpWhite++;
      if (i > 1) {
        if (S[i - 1] == '#') {
          BlackGroup[count - 1] = tmp;
        }
      }
    }
  }
  int ans = 200000;
  int tmpAns;
  if (count == 0)
    ans = 0;
  else {
    for (int j = 0; j < count; j++) {
      tmpAns = Black[j] + tmpWhite - White[j];
      if (tmpAns < ans) ans = tmpAns;
    }
  }
  cout << ans;
}
