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