#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int inf = 1e9 + 7;
int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int i = 0;
  while (s[i] == '.' && i < s.size()) {
    i++;
  }
  if (i == s.size()) {
    cout << 0 << endl;
    return 0;
  }
  vector<int> v, vv;
  if (s[0] == '.') v.push_back(0);
  while (1) {
    int c = 0;
    while (s[i] == '#' && i < s.size()) {
      c++;
      i++;
    }
    cout << i << endl;
    v.push_back(c);
    if (i == s.size()) break;
    c = 0;
    while (s[i] == '.' && i < s.size()) {
      c++;
      i++;
    }
    vv.push_back(c);
    if (i == s.size()) break;
  }
  if (s[s.size() - 1] == '.') v.push_back(0);
  for (int i = 1; i < v.size(); ++i) v[i] += v[i - 1];
  for (int i = 1; i < vv.size(); ++i) vv[i] += vv[i - 1];
  int ans = vv[vv.size() - 1];
  for (int i = 1; i < v.size(); ++i) {
    ans = min(ans, vv[vv.size() - 1] - vv[i - 1] + v[i - 1]);
  }
  cout << ans << endl;
}
