#include <bits/stdc++.h>
const int MAX_N = 200000;
int main() {
  int N;
  std::string S;
  std::cin >> N >> S;
  int black = 0, white = 0;
  bool flg = false;
  for (int i = 0; i < N; ++i) {
    if (flg) {
      if (S[i] == '#')
        ++black;
      else
        ++white;
    }
    if (S[i] == '#') flg = true;
  }
  std::cout << std::min(black + 1, white) << std::endl;
}
