#include int main() { int num; int box; scanf("%d", &num); box = (num % 10); box = box + (num / 10); for(int i = 0; i < 100; i++) { box = (box % 10) + (box / 10); if((0 <= box) && (box <= 9)) { printf("%d\n", box); return 0; } } }