#include <bits/stdc++.h>
int main() {
  int n;
  std::string stones;
  std::cin >> n >> stones;
  int count = 0;
  for (size_t i = 1; i < n; i++) {
    if ((stones[i - 1] == '#') && (stones[i] == '.')) {
      stones.insert(stones.begin() + i, '#');
      stones.erase(stones.begin() + i + 1);
      count += 1;
    }
  }
  printf("%d\n", count);
  return 0;
}
