N = int(input())
S = list(input())
count1 = 0
count2 = 0
count = 0
counter = []
flag = False

for i in range(N):
    if S[i] == '#':
        flag = True
    if S[i] == '.' and flag == True:
        count2 += 1

for i in range(N):
    if S[i] == '.':
        count1 += count
        count = 0
    else:
        count += 1

print(min(count1, count2))
