def stones(s):
    k = 0
    c = s.count('#')
    for i in range(len(s)-1):
        if s[i]=='#' and s[i+1]=='.':
            s[i+1] = '#'
            k = k+1
    return min(c,k)

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