# coding: utf-8

import sys
input = sys.stdin.readline

N = int(input())
S = input()

a = S.count("#")
b = S.count(".")

cnt = 0
for i in range(N - 1):
    if S[i : i + 2] == ".#":
        cnt += 1

print(min(a - cnt, b - cnt))
