format long

x = 1
dx = 1
n = 1

while abs(dx) > 1e-15
    dx = cos(x) - x;
    x = x + dx
    n = n + 1
end

n
