#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using ll = long long;
using ull = unsigned long long;
using ld = long double;
constexpr ll INF = 2e18;
constexpr ld EPS = 1e-9;
constexpr int MOD = 998244353;
template <typename T1, typename T2>
istream &operator>>(istream &istream, pair<T1, T2> &p) {
  istream >> p.first >> p.second;
  return istream;
}
template <typename T>
istream &operator>>(istream &istream, vector<T> &v) {
  for (auto &it : v) cin >> it;
  return istream;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &ostream, const pair<T1, T2> &p) {
  ostream << p.first << " " << p.second;
  return ostream;
}
template <typename T>
ostream &operator<<(ostream &ostream, const vector<T> &c) {
  for (auto &it : c) cout << it << " ";
  return ostream;
}
template <typename T>
T MIN(T first) {
  return first;
}
template <typename T, typename... Args>
T MIN(T first, Args... args) {
  return min(first, MIN(args...));
}
template <typename T>
T MAX(T first) {
  return first;
}
template <typename T, typename... Args>
T MAX(T first, Args... args) {
  return max(first, MAX(args...));
}
template <typename T>
void print(T &&t) {
  cout << t << "\n";
}
template <typename T, typename... Args>
void print(T &&t, Args &&...args) {
  cout << t << " ";
  print(forward<Args>(args)...);
}
template <typename T>
int32_t size_i(T &container) {
  return static_cast<int32_t>(container.size());
}
long long GCD(long long a, long long b) {
  if (!b) return a;
  return GCD(b, a % b);
}
long long LCM(long long a, long long b) { return (a * b) / GCD(a, b); }
long long modpow(ll x, long long n, long long m = MOD) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = (res * x) % m;
    x = (x * x) % m;
    n >>= 1;
  }
  return res;
}
long long binpow(long long x, long long n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * x;
    x = (x * x);
    n >>= 1;
  }
  return res;
}
long long modinv(long long x, long long m = MOD) { return modpow(x, m - 2, m); }
void preSolve() {}
void solve(long long tc) {
  long long n, m;
  cin >> n >> m;
  char a[n][m + 2];
  for (long long i = 0; i < n; i++) {
    a[i][0] = '#';
    a[i][m + 1] = '#';
    for (long long j = 1; j < m + 1; j++) cin >> a[i][j];
  }
  long long i = 0, j = 1, time = 0, dir = 1;
  map<long long, pair<long long, long long>> lr;
  map<long long, long long> d;
  map<long long, long long> cnt;
  for (long long i = 0; i <= n; i++) lr[i] = {INF, 0};
  while (i != n - 1) {
    if (a[i + 1][j] == '.') {
      i++;
      time++;
    } else if (a[i][j + dir] == '.') {
      if (dir == 1 && lr[i].second > j) {
        d[i] += abs(lr[i].second - j);
        time += abs(lr[i].second - j);
        j = lr[i].second;
      } else if (dir == -1 && lr[i].first < j) {
        d[i] += abs(lr[i].first - j);
        time += abs(lr[i].first - j);
        j = lr[i].first;
      } else {
        j += dir;
        d[i]++;
        time++;
        lr[i].first = min(lr[i].first, j);
        lr[i].second = max(lr[i].second, j);
      }
    } else if (a[i][j + dir] == '+') {
      a[i][j + dir] = '.';
      lr[i].first = min(lr[i].first, j);
      lr[i].second = max(lr[i].second, j);
      cnt[i]++;
      time++;
      dir *= -1;
    } else if (a[i][j + dir] == '#') {
      lr[i].first = min(lr[i].first, j);
      lr[i].second = max(lr[i].second, j);
      time++;
      cnt[i]++;
      dir *= -1;
    }
    if (d[i] > m * m) break;
    if (cnt[i] > 10 * m) break;
  }
  if (i == n - 1)
    cout << time;
  else
    cout << "Never";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(12) << fixed;
  preSolve();
  long long tests = 1;
  for (long long t = 1; t <= tests; t++) solve(t);
  return 0;
}
