#include #include #include #include int main() { int broj; scanf("%d", &broj); int zbir = 0; int posledna_cifra; while(broj > 0) { posledna_cifra = broj % 10; zbir += posledna_cifra; broj /= 10; } printf("%d\n", zbir); return 0; }