IDENTIFICATION DIVISION.
program-id. kyopuro.

data division.
working-storage section.
01 in-str pic x(12).
01 a pic 9(5).
01 b pic 9(5).
01 res pic 999.
01 t pic 9(5).
01 view-res pic zz9.

procedure division.
main.
    accept in-str.
    unstring in-str 
    delimited by all SPACE
    into
        a
        b.
    move 0 to res.
    
    compute t = b - a + 1.
    
    perform t times
        if (a(1 : 1) = a(5 : 1)) and (a(2 : 1) = a(4 : 1))
        then
            add 1 to res
        end-if
        add 1 to a
    end-perform.
    
    move res to view-res.
    display view-res.
    end run.