#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<pair<int, int> > v(n);
  for (int i = 0; i < n; i++) {
    v[i].first = 0;
    v[i].second = 0;
  }
  if (s[0] == '#')
    v[0].first = 1;
  else if (s[0] == '.')
    v[0].second = 1;
  for (int i = 1; i < n; i++) {
    if (s[i] == '#')
      v[i].first++;
    else if (s[i] == '.')
      v[i].second++;
    v[i].first += v[i - 1].first;
    v[i].second += v[i - 1].second;
  }
  int a = v[n - 1].first, b = v[n - 1].second;
  int ans = n;
  for (int i = 0; i < n; i++) {
    ans = min(v[i].first - v[i].second + b, ans);
  }
  cout << ans;
}
