#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  int cnt_a = 0, cnt_b = 0;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#')
      cnt_a++;
    else if (s[i] == '.')
      cnt_b++;
  }
  int cnt_c = 0, cnt_d = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '#')
      cnt_c--;
    else
      break;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      cnt_d--;
    else
      break;
  }
  int ans1 = min(cnt_a + cnt_c, cnt_a + cnt_d);
  int ans2 = min(cnt_b + cnt_c, cnt_b + cnt_d);
  long long ans = min(ans1, ans2);
  cout << ans << endl;
}
