data = "123d"
try:
  n = int(data)
except ValueError:
  n = 999
print n

