def max_digit(x):
import math
a=0
while x>0:
if a<=(x%10):
a=(x%10)
x=math.floor(x/10)
else:
a=a
x=math.floor(x/10)
if x==0:
a=a
return a



