# -*- coding: utf-8 -*-
"""
Created on Sat Apr 20 19:26:31 2019
Tenka1C
@author: maezawa
"""

n = int(input())
s = input()
#n = len(s)

cnt = 0
k = -1
for i in range(n):
    if s[i] == '#':
        k = i
        break
if k == n-1:
    pass
elif k == -1:
    pass      
else:
    for j in range(k, n):
        if s[j] == '.':
            cnt += 1


cnt2 = 0
k2 = -1
for i in range(n):
    if s[i] == '.':
        k2 = i
        break
if k2 == n-1:
    pass
elif k2 == -1:
    pass      
else:
    for j in range(k2, n):
        if s[j] == '#':
            cnt2 += 1

print(min(cnt,cnt2))