#include <bits/stdc++.h>
using namespace std;
const int N = 705;
const int base = 1000, L = 60;
void mul(int *c, int *a, int *b) {
  c[0] = a[0] + b[0] + 3;
  for (int i = 1; i <= a[0]; i++)
    for (int j = 1; j <= b[0]; j++) c[i + j - 1] += a[i] * b[j];
  for (int i = 1; i <= c[0]; i++) c[i + 1] += c[i] / base, c[i] %= base;
  while (c[0] > 1 && !c[c[0]]) c[0]--;
}
bool big(int *a, int *b) {
  if (a[0] < b[0]) return 0;
  if (a[0] > b[0]) return 1;
  for (int i = a[0]; i; i--) {
    if (a[i] < b[i]) return 0;
    if (a[i] > b[i]) return 1;
  }
  return 0;
}
void updata(int *a, int *b, int *c) {
  int tmp[L];
  memset(tmp, 0, sizeof(tmp));
  mul(tmp, b, c);
  if (big(tmp, a)) memcpy(a, tmp, sizeof(tmp));
}
void prt(int *a) {
  printf("%d", a[a[0]]);
  if (a[0] == 0) {
    printf("\n");
    return;
  }
  for (int i = a[0] - 1; i; i--) printf("%03d", a[i]);
  printf("\n");
}
struct Edge {
  int v, next;
  Edge() {}
  Edge(int v, int next) : v(v), next(next) {}
} e[N * 2];
int head[N], total;
void init() {
  memset(head, -1, sizeof(head));
  total = 0;
}
void adde(int u, int v) {
  e[total] = Edge(v, head[u]);
  head[u] = total++;
}
int dp[N][N][L], s[N];
void dfs(int u, int f) {
  s[u] = 1;
  memset(dp[u], 0, sizeof(dp[u]));
  dp[u][1][0] = dp[u][1][1] = 1;
  for (int i = head[u]; i != -1; i = e[i].next) {
    int v = e[i].v;
    if (v == f) continue;
    dfs(v, u);
    for (int i = s[u]; i >= 0; i--)
      for (int j = s[v]; j >= 0; j--) {
        updata(dp[u][i + j], dp[u][i], dp[v][j]);
      }
    s[u] += s[v];
  }
  int d[L];
  memset(d, 0, sizeof(d));
  d[0] = 1;
  for (int i = 1; i <= s[u]; i++) {
    d[1]++;
    updata(dp[u][0], dp[u][i], d);
  }
}
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    init();
    for (int i = 1; i < n; i++) {
      int x, y;
      scanf("%d%d", &x, &y);
      adde(x, y);
      adde(y, x);
    }
    dfs(1, 0);
    prt(dp[1][0]);
  }
  return 0;
}
