def touchingdigits(a):
s = str(a)
for i in range(1, len(s)):
if s[i] == s[i-1]:
return True
return False
ct = 10000
for i in range(10000, 1000000):
if touchingdigits(i):
ct += 1
print(ct)
ZGVmIHRvdWNoaW5nZGlnaXRzKGEpOgoJcyA9IHN0cihhKQoJZm9yIGkgaW4gcmFuZ2UoMSwgbGVuKHMpKToKCQlpZiBzW2ldID09IHNbaS0xXToKCQkJcmV0dXJuIFRydWUKCXJldHVybiBGYWxzZQoKY3QgPSAxMDAwMApmb3IgaSBpbiByYW5nZSgxMDAwMCwgMTAwMDAwMCk6CglpZiB0b3VjaGluZ2RpZ2l0cyhpKToKCQljdCArPSAxCgkJCnByaW50KGN0KQ==