#include <bits/stdc++.h>
using namespace std;
void solve(void) {
  int n;
  string s;
  cin >> n >> s;
  int cta = 0;
  for (int i = 0; i < (long long)n; ++i)
    if (s[i] == '.') cta++;
  bool f = false;
  int c = 0;
  for (int i = n - 1; i >= 0; --i) {
    if (f) c++;
    if (s[i] == '#') f = true;
  }
  cout << min(cta, c) << endl;
}
int main(void) { solve(); }
