#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1000000000;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long ans = 0;
  bool flag = (s[0] == '.');
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') flag = false;
    ans += (!flag && s[i] == '.');
  }
  reverse(s.begin(), s.end());
  long long tmp = 0;
  flag = (s[0] == '#');
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.') flag = false;
    tmp += (!flag && s[i] == '#');
  }
  ans = min(ans, tmp);
  cout << ans << endl;
  return 0;
}
