#sum of digit
no=int(input("Enter three digit no = "))
a=no%10
b=no//10
c=b//10
s=a+c
print("sum of first and last digit is = ",s)


print("\n\n\n\n")





no1=int(input("Enter four digit no = "))
a1=no1%10
b2=no1//10
c2=b2//10
d2=c2//10
s1=a1+d2
print("Sum of first and last digit is = ",s1)



