#include <stdio.h>

int main(void)
{
    char d[] = "1010101", *p;
    int total = 0;

    for (p = d; *p; p++)
        total += (*p == '1');
    printf("%s ==> %d\n", d, total);

    return 0;
}
