#include <bits/stdc++.h>
using namespace std;
int const N = 3e5 + 10, oo = 1e9;
long long const OO = 2e18;
double const eps = 1e-8, PI = acos(-1);
int mod = oo + 7;
int cum[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) cum[i + 1] = cum[i] + (s[i] == '.');
  int an = min(cum[n], n - cum[n]);
  for (int i = 0; i < n; i++) an = min(an, i + 1 + cum[n]);
  cout << an;
  return 0;
}
