#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int count = 0;
  int ans = 0;
  for (int i = n - 1; i > 0; i--) {
    for (int j = 0; j < n; j++) {
      if (s[j] == '.' && s[j + 1] == '#' || s[j] == '#' && s[j + 1] == '.') {
        count++;
      }
    }
    if (count == 1) {
      count = 0;
      break;
    }
    if (s[i] == '.' && s[i - 1] == '#') {
      ans++;
      s[i - 1] = '#';
    }
  }
  cout << ans << endl;
  return 0;
}
