#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::string S;
  std::cin >> S;
  std::string S1 = S;
  std::string S2 = S;
  int cnt1 = 0;
  for (int i = 0; i < N - 1; ++i) {
    if (S1[i] == '#' && S1[i + 1] == '.') {
      S1[i + 1] = '#';
      ++cnt1;
    }
  }
  int cnt2 = 0;
  for (int i = N; i > 0; --i) {
    if (S2[i - 1] == '#' && S2[i] == '.') {
      S2[i - 1] = '.';
      ++cnt2;
    }
  }
  std::cout << std::min(cnt1, cnt2) << std::endl;
}
