#include <bits/stdc++.h>
using namespace std;
const char BLACK = '#';
const char WHITE = '.';
uint getResult(const int strSize, string &str) {
  for (int i = 1;; i++) {
    if (i >= strSize - 1) return 0;
    if (str[i] == BLACK && str[i + 1] == WHITE) {
      str.erase(0, i);
      break;
    }
  }
  for (int i = strSize - 3; i >= 0; i--) {
    if (str[i] == BLACK && str[i + 1] == WHITE) {
      str.erase(i + 2);
      break;
    }
  }
  uint blackCount = 0;
  uint whiteCount = 0;
  for (char c : str) {
    if (c == BLACK) {
      blackCount++;
    } else {
      whiteCount++;
    }
  }
  return min(blackCount, whiteCount);
}
int main() {
  uint N;
  string S;
  cin >> N >> S;
  uint result = getResult(N, S);
  cout << result;
  return 0;
}
