#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long MOD = 1e9 + 7;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int index = 0;
  for (long long i = 0; i < (n - 1); i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      index = i + 1;
    }
  }
  int cnt = 0;
  for (long long i = 0; i < (index + 1); i++) {
    if (s[i] == '#') cnt++;
  }
  int ans = 0;
  for (long long i = 0; i < (index + 1); i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      ans++;
      s[i + 1] = '#';
    }
  }
  cout << min(cnt, ans) << endl;
  return 0;
}
