#include <bits/stdc++.h>
using namespace std;
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
  for (T& x : vec) is >> x;
  return is;
}
using ll = long long;
using VI = vector<int>;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  int ans2 = 0;
  int ans3 = 0;
  string tmp = s;
  for (int i = n - 1; i > 0; i--) {
    if (s[i] == '.' and s[i - 1] == '#') {
      ans++;
      s[i - 1] = '.';
    }
  }
  s = tmp;
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '#' and s[i + 1] == '.') {
      ans2++;
      s[i + 1] = '#';
    }
  }
  s = tmp;
  for (int count = 0;; count++) {
    for (int i = s.size();; i--) {
      if (s.size() == 0) break;
      if (s[i - 1] == '#')
        s.erase(--s.end());
      else
        break;
    }
    for (int i = 0;; i++) {
      if (s.size() == 0) break;
      if (s[i] == '.')
        s.erase(s.begin());
      else
        break;
    }
    if (s.size() == 0) break;
    if (*--s.end() == '.') {
      ans3++;
      *--s.end() = '#';
    }
    if (*s.begin() == '#') {
      ans3++;
      *s.begin() = '.';
    }
  }
  cout << min(ans, min(ans2, ans3)) << endl;
  return 0;
}
