#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  int right_black = 0;
  bool count_black = true;
  int white = 0;
  int black = 0;
  for (int i = n - 1; i >= 0; --i) {
    if (count_black) {
      if (s[i] == '#') {
        ++right_black;
      } else {
        count_black = false;
      }
    }
    if (s[i] == '.') {
      ++white;
    } else {
      ++black;
    }
  }
  if (white == n || black == n) {
    cout << "0";
  } else {
    int ans1 = white;
    int ans2 = n - white - right_black;
    int ans = min(ans1, ans2);
    cout << ans;
  }
  return 0;
}
