#include <bits/stdc++.h>
using namespace std;
const long long int LINF = 2000000000000000000ll;
const int INF = 1000000100;
const long long int MOD = 1e9 + 7;
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> w(n);
  int bc = INF;
  if (s[0] == '.')
    w[0] = 1;
  else
    w[0] = 0;
  for (int i = 1; i < (n); ++i) {
    w[i] = w[i - 1];
    if (s[i] == '.') w[i]++;
    if (s[i] == '#' && s[i - 1] == '.') bc = i;
  }
  int ans = n - w[n - 1];
  ans = min(ans, w[n - 1]);
  if (bc != INF) {
    ans = min(ans, bc - w[bc]);
    if (s[n - 1] == '.') ans++;
  }
  cout << ans << endl;
  return 0;
}
