#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 7;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int pos = 0;
  int ans1 = 0;
  string stemp = s;
  while (pos < n && stemp[pos] == '#') ++pos;
  while (pos < n) {
    if (stemp[pos] == '.') ++ans1;
    ++pos;
  }
  pos = 0;
  int ans2 = 0;
  stemp = s;
  reverse(stemp.begin(), stemp.end());
  while (pos < n && stemp[pos] == '#') ++pos;
  while (pos < n) {
    if (stemp[pos] == '#') ++ans2;
    ++pos;
  }
  cout << min(ans1, ans2) << "\n";
  return 0;
}
