#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>

int rek(int broj) {
    while(broj > 9) {
        int posledna = broj % 10;
        int pretposledna = (broj / 10) % 10;
        if(pretposledna >= posledna) {
            return 0;
        }
        broj /= 10;
    }
    return 1;
}
int main(int argc, char * argv[]) {
    int n;
    scanf("%d", &n);
    printf("%d\n", rek(n));
    return 0;
}
