# -*- coding: utf-8 -*-
n = int(input())
s = input()

cnt_start = False

wcnt = 0
bcnt = 0

for c in s:
    if c == '.':
        cnt_start = True
        continue

    if not cnt_start:
        continue
    else:
        bcnt += 1

cnt_start = False

for c in s:
    if c == "#":
        cnt_start = True
        continue

    if not cnt_start:
        continue
    else:
        wcnt += 1

print(min(bcnt, wcnt))
