#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>

#define MAX_BUF 256

int inln_strlen(char *s)
{
  int ret; /* povratna vrednost */

  __asm__(
  "cld\n\t"
  "mov ecx, -1\n\t"
  "mov al, 0\n\t"
  "repnz scasb\n\t"
  "neg ecx\n\t"
  "sub ecx, 2\n\t"
  : "=c"(ret)  /* alociramo ecx za rezultat */
  : "D"(s)     /* alociramo edi za vrednost s */
  : "eax"     /* menjamo eax */
  );

  return ret;
}


int main()
{

  char buffer[MAX_BUF];
  char *pos = NULL;

  assert(fgets(buffer, MAX_BUF, stdin) != NULL);
 
  if((pos = strchr(buffer, '\n')) != NULL)
   *pos = '\0';
  
  printf("%d\n", inln_strlen(buffer));
  

  return EXIT_SUCCESS;
}
