#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int k = 0, m = 0;
  long n;
  cin >> n >> s;
  for (long i = 0; i < n; ++i) {
    if (s.substr(i, 1) == ".") {
      for (long j = i - 1; j > -1; --j) {
        if (s.substr(j, 1) == "#")
          ++k;
        else
          break;
      }
      ++m;
    }
  }
  if (m > k)
    cout << k << "\n";
  else
    cout << m << "\n";
  return 0;
}
