#include <stdio.h>

#define URL_SIZE    200
#define MAX_NURLS  10000

int main() {

  /* Arrays for storing URLs */
  char urls[MAX_NURLS][URL_SIZE];
  int  count[MAX_NURLS];
  int  nurls = 0;
  int  index;
 
  int state = 0;
  int c;

  while (1) {
    c = getchar();
    if (c == EOF) {
      break;
    }
    switch(state) {
    case 0:
      if (c == 'h') state = 1;
      break;
    case 1:
      if (c == 't') state = 2;
      else state = 0;
      break;
    case 2:
      if (c == 't') state = 3;
      else state = 0;
      break;
    case 3:
      if (c == 'p') state =4 ;
      else state = 0;
      break;
    case 4:
      if (c == ':') state = 5;
      else state = 0;
      break;
    case 5:
      if (c == '/') state = 6;
      else state = 0;
      break;
    case 6:
      if (c == '/') {
	state = 7;
	index = 0;   /* reset character index */
      }
      else state = 0;
      break;
    case 7:
      if (((c >= 'A') && (c <= 'Z')) ||
	  ((c >= 'a') && (c <= 'z')) ||
	  ((c >= '0') && (c <= '9')) ||
	  (c == '_') || (c == '-') ||  
	  (c == '.')) {

	/* Store URL instead of printing */
	urls[nurls][index] = c;
	index++;
      } else {
	/* Done getting URL */
	urls[nurls][index] = '\0';    /* End of string */

	{
	  int j;
	  for (j = nurls - 1; j >= 0; j--) {
	    if (strcmp(urls[j],urls[nurls]) == 0) {
	      /*        ^^^^    ^^^^^^^^    */
              /*      previous    just read */
               
	      count[j]++;  /* Increment count of match */
              /* The same */
	      break;
	    }
	  }
	  if (j < 0) {
	    /* No match */
	    /* Save URL */
	    count[nurls] = 1;
	    nurls++;
	  }
	}
	state = 0;
      }
      break;
    }
  }
  {
    /* Sort */
    
    int i;
    int j;

    for (i = 0; i < nurls ;i++ ) {
      for (j = i; j < nurls; j++) {
	if (count[i] < count[j]) {
	  /* Swap */
	  int t;
	  char tc[URL_SIZE];

	  /* Swap count */
	  t = count[i];
	  count[i] = count[j];
	  count[j] = t;

	  /* Swap Url */ 
	  strcpy(tc,urls[i]);
	  strcpy(urls[i],urls[j]);
	  strcpy(urls[j],tc);
	}
      }
    }
  }
  {
    int i;
    for (i = 0; i < nurls; i++) {
      printf("count[%d] = %d, urls[%d] = '%s'\n", i, count[i], i, urls[i]);
    }
  }
}

      
