#include <bits/stdc++.h>
using namespace std;
template <size_t SIZE, class T>
inline size_t array_size(T (&arr)[SIZE]) {
  return SIZE;
}
int main() {
  int N;
  string S;
  cin >> N >> S;
  int num = 0;
  {
    bool st = false;
    for (int i = 0; i < S.length(); ++i) {
      if (!st && S[i] == '#') {
        st = true;
        continue;
      }
      if (st && S[i] == '.') {
        ++num;
      }
    }
  }
  int num2 = 0;
  {
    bool st = false;
    reverse(S.begin(), S.end());
    for (int i = 0; i < S.length(); ++i) {
      if (!st && S[i] == '.') {
        st = true;
        continue;
      }
      if (st && S[i] == '#') {
        ++num2;
      }
    }
  }
  cout << (num < num2 ? num : num2) << endl;
  return 0;
}
