#include <stdio.h>

int main() {
    int num = 0, count = 0;

    printf("To quit, enter 0\n");
    while (1) {
        printf("Please, enter number: ");
        scanf("%d", &num);
        if (num == 0) {
            break;
        }
        if (num % 10 == 7) count++;
    }
    printf("Count = %d\n",count);
}
