#include <bits/stdc++.h>
using namespace std;
template <class A>
void pr(A a) {
  cout << (a) << endl;
}
template <class A, class B>
void pr(A a, B b) {
  cout << a << " ";
  pr(b);
}
template <class A, class B, class C>
void pr(A a, B b, C c) {
  cout << a << " ";
  pr(b, c);
}
template <class A, class B, class C, class D>
void pr(A a, B b, C c, D d) {
  cout << a << " ";
  pr(b, c, d);
}
int main(void) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> ans(2, 0);
  int cur = 0;
  for (int i = int(n) - 1; i >= 0; --i) {
    if (s[i] == '.') {
      cur = i;
      break;
    }
  }
  for (int i = 0; i < int(cur); ++i) {
    if (s[i] == '#') ans[0]++;
  }
  for (int i = 0; i < int(n); ++i) {
    if (s[i] == '#') {
      cur = i;
      break;
    }
  }
  for (int i = n - 1; i >= cur; i--) {
    if (s[i] == '.') ans[1]++;
  }
  sort(ans.begin(), ans.end());
  pr(ans[0]);
}
