#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 check(string &s, int cur) {
  int ans = 0;
  for (int i = 0; i < int(cur); ++i) {
    if (s[i] == '#') ans++;
  }
  for (int i = cur; i < s.size(); i++) {
    if (s[i] == '.') ans++;
  }
  return ans;
}
int main(void) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> ans(n, 1e9L);
  for (int i = 0; i < int(n - 1); ++i) {
    if (s[i] != s[i + 1]) ans[i] = check(s, i);
  }
  sort(ans.begin(), ans.end());
  pr(ans[0] != 1e9L ? ans[0] : 0);
}
