#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int a1, ans, wn;
bool isWshow, isBshow;
int main() {
  cin >> n >> s;
  for (long long i = (long long)0; i < (long long)n; ++i) {
    if (s[i] == '#')
      isBshow = true;
    else if (isBshow) {
      a1++;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.')
      isWshow = true;
    else if (isWshow) {
      ans++;
    }
  }
  for (long long i = (long long)0; i < (long long)n; ++i) {
    if (s[i] == '.') wn++;
  }
  ans = min(a1, min(ans, wn));
  cout << ans << endl;
  return 0;
}
