Everything works correctly now. Wrote mystrtol function.