Skip to content

Instantly share code, notes, and snippets.

@ytakashina
Created February 28, 2018 11:24
Show Gist options
  • Save ytakashina/e46e191a982f4409ee28c7ca8ba3a5b4 to your computer and use it in GitHub Desktop.
Save ytakashina/e46e191a982f4409ee28c7ca8ba3a5b4 to your computer and use it in GitHub Desktop.
  • IO
N = int(input())
l = len(str(N))-1
print(l*9 + ((N+1)//(10**l)-1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment