def main():
    n = int(input())
    s = list(input())
    if '#' not in s or '.' not in s:
        print(0)
        return 0
    ans = sorted(s, reverse=True).index('#')
    cnt = 0
    for i in range(ans+1):
        if s[i] == '#':
            cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()
