#include <bits/stdc++.h>
using namespace std;
inline void FAST_IO() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int n;
string s;
map<char, int> v{{'#', 0}, {'.', 1}};
int tb[200000][2];
int dp(int i, int color) {
  if (i == n) return 0;
  if (tb[i][color] != -1) return tb[i][color];
  if (color == v['#']) {
    return tb[i][color] = dp(i + 1, v['#']) + (s[i] == '.');
  } else {
    int take = dp(i + 1, (s[i] == '#' ? v['.'] : v['#'])) + 1;
    int notTake = dp(i + 1, v[s[i]]);
    return tb[i][color] = min(take, notTake);
  }
}
int main() {
  FAST_IO();
  memset(tb, -1, sizeof(tb));
  cin >> n >> s;
  cout << dp(0, (s[0] == '#' ? v['#'] : v['.'])) << endl;
  return 0;
}
