#include <bits/stdc++.h>
using namespace std;
const int N = 705;
int n;
vector<int> G[N];
int sz[N];
const int W = 10000;
struct number {
  int l;
  int a[30];
  void out() {
    printf("%d", a[l - 1]);
    for (int i = l - 2; i >= 0; i--) printf("%04d", a[i]);
  }
} c;
void Copy(number& a, const number& b) {
  a.l = b.l;
  memcpy(a.a, b.a, sizeof(int) * (a.l));
}
void Mul(const number& a, const int b) {
  Copy(c, a);
  c.a[c.l] = 0;
  for (int i = 0; i < c.l; i++) c.a[i] *= b;
  for (int i = 0; i < c.l; i++)
    if (c.a[i] >= W) c.a[i + 1] += c.a[i] / W, c.a[i] %= W;
  if (c.a[c.l]) c.l++;
}
void Mul(const number& a, const number& b) {
  c.l = a.l + b.l - 1;
  memset(c.a, 0, sizeof(int) * (c.l + 1));
  for (int i = 0; i < a.l; i++)
    for (int j = 0; j < b.l; j++) c.a[i + j] += a.a[i] * b.a[j];
  for (int i = 0; i < c.l; i++)
    if (c.a[i] >= W) c.a[i + 1] += c.a[i] / W, c.a[i] %= W;
  if (c.a[c.l]) c.l++;
}
void Ckmax(number& a, const number& b) {
  if (a.l < b.l) {
    Copy(a, b);
    return;
  }
  if (a.l > b.l) return;
  for (int i = a.l - 1; i >= 0; i--) {
    if (a.a[i] < b.a[i]) {
      Copy(a, b);
      return;
    }
    if (a.a[i] > b.a[i]) return;
  }
}
number f[N][N];
number dp[N];
void dfs(int u, int father) {
  sz[u] = 1;
  f[u][1].l = 1;
  f[u][1].a[0] = 1;
  for (auto v : G[u])
    if (v != father) {
      dfs(v, u);
      sz[u] += sz[v];
      for (int j = sz[u]; j >= 1; j--) {
        if (f[u][j].l) {
          Mul(f[u][j], dp[v]);
          Copy(f[u][j], c);
        }
        for (int k = max(1, j - sz[u] + sz[v]); k <= sz[v] && k <= j - 1; k++) {
          Mul(f[u][j - k], f[v][k]);
          Ckmax(f[u][j], c);
        }
      }
    }
  for (int i = 1; i <= sz[u]; i++) {
    Mul(f[u][i], i);
    Ckmax(dp[u], c);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1, x, y; i <= n - 1; i++) {
    scanf("%d%d", &x, &y);
    G[x].push_back(y);
    G[y].push_back(x);
  }
  dfs(1, 0);
  dp[1].out();
  return 0;
}
