#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  string s;
  int ans = 0;
  cin >> n;
  cin >> s;
  for (size_t i = 0; i < n; i++)
    if ('.' == s[i]) ans++;
  int cnt = ans;
  for (size_t i = 0; i < n; i++) {
    if ('.' == s[i])
      cnt--;
    else if ('#' == s[i])
      cnt++;
  }
  ans = min(ans, cnt);
  cout << ans << endl;
  return 0;
}
