#include <bits/stdc++.h>
using namespace std;
int GCD(int a, int b) { return b ? GCD(b, a % b) : a; }
int LCM(int a, int b) { return (a * b) / GCD(a, b); }
int abs(int x) { return x > 0 ? x : -x; }
int main() {
  int n;
  long long ans1 = 0;
  long long ans2 = 0;
  string s;
  cin >> n >> s;
  if (s[0] == '#') {
    for (int i = 0; i < n; i++)
      if (s[i] == '.') ans1++;
    for (int i = 0; i < n; i++)
      if (s[i] == '#') ans2++;
    if (s[n - 1] == '#') ans2--;
    cout << min(ans1, ans2) << endl;
    return 0;
  } else {
    bool flag = 0;
    for (int i = 0; i < n; i++)
      if (s[i] == '#') ans2++;
    if (s[n - 1] == '#') ans2--;
    for (int i = 0; i < n; i++) {
      if (s[i] == '#') flag = 1;
      if (s[i] == '.' and flag) ans1++;
    }
    cout << min(ans1, ans2) << endl;
  }
}
