#include <bits/stdc++.h>
int main() {
  int N;
  std::string S;
  std::cin >> N >> S;
  int BlackPos = 0;
  int BlackNum = 0;
  int WhiteNum = 0;
  bool find = false;
  for (int i = 0; i < S.length(); i++) {
    if (S[i] == '#') {
      if (find == false) {
        find = true;
        ++BlackNum;
      } else {
        ++BlackNum;
      }
    } else {
      ++WhiteNum;
    }
  }
  std::cout << (BlackNum < WhiteNum ? BlackNum : WhiteNum) << std::endl;
  return (0);
}
