#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys

input = sys.stdin.readline
N = int(input())
S = input().strip()
a = 0

if S.count('#') > S.count('.'):
    a += (S.count('.'))
    if S[-2] == '.' and S[-1] == '#':
        a -= 1
else:
    a += (S.count('#'))

print(a)

