#include <bits/stdc++.h>
using namespace std;
struct speed {
  speed() {
    cin.tie();
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(18);
  }
} speed;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans1 = 0;
  int flag1 = 0;
  int ans2 = 0;
  int flag2 = 0;
  for (int i = 0; i < n; i++) {
    if (flag1) {
      if (s[i] == '.') ans1++;
    } else if (s[i] == '#')
      flag1 = 1;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (flag2) {
      if (s[i] == '#') ans2++;
    } else if (s[i] == '.')
      flag2 = 1;
  }
  cout << min(ans1, ans2) << "\n";
}
