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

int main()
{
  int n, k, res = 1;
  char s[99];

  scanf("%d%s", &n, s);
  k = strlen(s);
  while (n > 0)
    res *= n, n -= k;
  printf("%d\n", res);
  return 0;
}