import sys
input = sys.stdin.readline


n = int(input())
s = input()
s = list(s)
# print(s)



pre = s[0]
for i in range(1, n):
    if pre=='#' and s[i]=='.':
        temp = i
        break
    pre = s[i]


# print(temp)
try:
    s = s[temp:]
    ans = sum(1 for x in s if x=='.')
    ans2 = sum(1 for x in s if x=='#') + 1
    if s[-1]=='#':
        ans -=1
        ans2 -=1

    print(min(ans, ans2))
except:
    print(0)