#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}
void solve(long long N, std::string S) {
  ll ansb = 0;
  ll answ = 0;
  for (int i = 0; i + 1 < N; i++) {
    if (S[i] == '#' and S[i + 1] == '.') {
      i++;
      while (i < N and S[i] == '.') {
        ansb++;
        i++;
      }
    }
  }
  for (int i = N - 1; i - 1 >= 0; i--) {
    if (S[i] == '.' and S[i - 1] == '#') {
      i--;
      while (i >= 0 and S[i] == '#') {
        answ++;
        i--;
      }
    }
  }
  std::cout << min(ansb, answ) << std::endl;
}
int main() {
  long long N;
  scanf("%lld", &N);
  std::string S;
  std::cin >> S;
  solve(N, S);
  return 0;
}
