#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  long long int n, ans = 0;
  string s;
  cin >> n;
  cin >> s;
  string s1 = s;
  for (long long int i = 0; i < s.size() - 1; i++) {
    if (s1[i] == '#' && s1[i + 1] == '.') {
      s1[i + 1] = '#';
      ans++;
    }
  }
  string s2 = s;
  long long int temp_2 = 0;
  for (long long int i = s.size() - 1; i > 0; i--) {
    if (s2[i] == '.' && s2[i - 1] == '#') {
      s2[i - 1] = '.';
      temp_2++;
    }
  }
  if (temp_2 < ans) ans = temp_2;
  cout << ans << endl;
}
