#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toStr(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX / 2;
const int MOD = 1000000007;
int main() {
  int N;
  string S1, S2;
  cin >> N >> S1;
  S2 = S1;
  int ans1 = 0, ans2 = 0;
  bool ok = true;
  ;
  for (int i = (0); i <= ((N - 1) - 1); ++i) {
    if (S1[i] == '#' && S1[i + 1] == '.') {
      ans1++;
      S1[i + 1] = '#';
    }
  }
  for (int i = (0); i <= ((N - 1) - 1); ++i) {
    if (S2[N - i - 2] == '#' && S2[N - i - 1] == '.') {
      ans2++;
      S2[N - i - 2] = '.';
    }
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}
