#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = 0, cnt = 0;
  int ans2 = 1;
  bool flag = false;
  for (int i = 0; i < n; i++) {
    if (!flag && s[i] == '#')
      flag = true;
    else if (flag) {
      if (s[i] == '.')
        cnt++;
      else {
        ans2++;
        ans += cnt;
        cnt = 0;
      }
    }
  }
  cout << min(ans, ans2) << endl;
  return 0;
}
