#include <bits/stdc++.h>
using namespace std;
char a[2001];
int N;
void read() {
  scanf("%s", &a);
  N = strlen(a);
}
bool isPal[2001][2001];
long long dp[2001], cnt[2001];
void solve() {
  for (int len = 1; len <= N; len++)
    for (int l = 0; l < N; l++) {
      int r = l + len - 1;
      if (len == 1)
        isPal[l][r] = true;
      else if (len == 2)
        isPal[l][r] = (a[l] == a[r]);
      else
        isPal[l][r] = (isPal[l + 1][r - 1]) && (a[l] == a[r]);
    }
  for (int l = 0; l < N; l++)
    for (int r = l; r < N; r++) cnt[l] += isPal[l][r];
  for (int i = 0; i < N; i++)
    for (int j = i; j < N; j++) dp[i] += cnt[j];
  long long ans = 0;
  for (int l = 0; l < N; l++)
    for (int r = l; r < N; r++) ans += isPal[l][r] * dp[r + 1];
  printf("%I64d\n", ans);
}
int main() {
  read();
  solve();
  return 0;
}
