#include <bits/stdc++.h>
using namespace std;
void wf(int v, int d[][3]) {
  for (int k = 0; k < v; k++) {
    for (int i = 0; i < v; i++) {
      for (int j = 0; j < v; j++) {
        d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
      }
    }
  }
}
long long gcd(long long a, long long b) {
  long long old_a, old_b;
  while (b != 0) {
    old_a = a;
    a = b;
    old_b = b;
    b = old_a % b;
  }
  return old_b;
}
long long lcm(long long a, long long b) {
  long long old_old_a = a, old_old_b = b;
  long long old_a, old_b;
  while (b != 0) {
    old_a = a;
    a = b;
    old_b = b;
    b = old_a % b;
  }
  long long g = old_b;
  return old_old_a / g * old_old_b;
}
int ctoi(char num) { return num - '0'; }
void sorted(int list[], int size, bool order) {
  if (order == 0) {
    sort(list, list + size);
  } else {
    sort(list, list + size, greater<int>());
  }
}
int nPr(int n, int r) {
  int ans = 1;
  for (int i = 0; i < r; i++) {
    ans *= n;
    n--;
  }
  return ans;
}
int nCr(int n, int r) {
  int ans = 1;
  int m = 1;
  int l = r;
  for (int i = 0; i < r; i++) {
    ans *= n;
    n--;
    m *= l;
    l--;
  }
  return ans / m;
}
int eval(vector<char> s) {
  vector<int> num;
  vector<char> ope;
  int number = ctoi(s[0]);
  for (int i = 1; i < s.size(); i++) {
    if (s[i] == '+') {
      ope.push_back('+');
      num.push_back(number);
      number = 0;
    } else if (s[i] == '-') {
      ope.push_back('-');
      num.push_back(number);
      number = 0;
    } else {
      number = number * 10 + ctoi(s[i]);
    }
    if (i == s.size() - 1) {
      num.push_back(number);
    }
  }
  int ans = num[0];
  for (int i = 1; i < num.size(); i++) {
    if (ope[i - 1] == '+') {
      ans += num[i];
    } else if (ope[i - 1] == '-') {
      ans -= num[i];
    }
  }
  return ans;
}
bool Isprime(int num) {
  if (num < 2)
    return false;
  else if (num == 2)
    return true;
  else if (num % 2 == 0)
    return false;
  double sqrtNum = sqrt(num);
  for (int i = 3; i <= sqrtNum; i += 2) {
    if (num % i == 0) {
      return false;
    }
  }
  return true;
}
int soed(int i) {
  int sum = 0;
  string s = to_string(i);
  for (int j = 0; j < s.length(); j++) {
    sum += s[j] - '0';
  }
  return sum;
}
class Union_find {
  int par[100010], rank[100010];
  void init(int n) {
    for (int i = 0; i < n; i++) {
      par[i] = i;
      rank[i] = 0;
    }
  }
  int find(int x) {
    if (par[x] == x) {
      return x;
    } else {
      return par[x] == find(par[x]);
    }
  }
  void unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) {
      return;
    }
    if (rank[x] < rank[y]) {
      par[x] = y;
    } else {
      par[y] = x;
      if (rank[x] == rank[y]) {
        rank[x]++;
      }
    }
  }
  bool same(int x, int y) { return find(x) == find(y); }
};
class union_find {
 public:
  vector<int> parent;
  union_find(int n) { parent = vector<int>(n, -1); }
  int root(int a) {
    if (parent[a] < 0) {
      return a;
    } else {
      return parent[a] = root(parent[a]);
    }
  }
  int size(int a) { return -parent[root(a)]; }
  bool connect(int a, int b) {
    a = root(a);
    b = root(b);
    if (a == b) {
      return false;
    } else {
      if (size(a) > size(b)) {
        swap(a, b);
      }
      parent[a] += parent[b];
      parent[b] = a;
      return true;
    }
  }
};
int h, w;
char grid[50][50];
int d[50][50];
int inf = -1;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int bfs() {
  int sy = 0, sx = 0, gy = h - 1, gx = w - 1;
  int r = h, c = w;
  queue<pair<int, int>> que;
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      d[i][j] = inf;
    }
  }
  que.push(pair<int, int>(sy, sx));
  d[sy][sx] = 0;
  while (que.size() > 0) {
    pair<int, int> p = que.front();
    que.pop();
    if (p.first == gy && p.second == gx) {
      break;
    }
    for (int i = 0; i < 4; i++) {
      int ny = p.first + dy[i], nx = p.second + dx[i];
      if (0 <= ny && ny < r && 0 <= nx && nx < c && grid[ny][nx] != '#' &&
          d[ny][nx] == inf) {
        que.push(pair<int, int>(ny, nx));
        d[ny][nx] = d[p.first][p.second] + 1;
      }
    }
  }
  return d[gy][gx];
}
int main() {
  int n;
  string s;
  cin >> n >> s;
  int count = 0;
  int c = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      c++;
    }
  }
  if (s[0] == '#' && s[1] == '.') {
    s[0] = '.';
    count++;
  }
  for (int i = 1; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      if (s[i - 1] == '#') {
        s[i + 1] = '#';
      } else {
        s[i] = '.';
      }
      count++;
    }
  }
  cout << min(c, count) << endl;
  return 0;
}
