#include <bits/stdc++.h>
using namespace std;
const int64_t LG = 1e4 + 5;
int64_t g[105][LG];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int64_t n, m;
  cin >> n >> m;
  for (int64_t i = 1; i <= n; i++) {
    g[i][0] = 2;
    g[i][m + 1] = 2;
    for (int64_t j = 1; j <= m; j++) {
      char c;
      cin >> c;
      if (c == '+')
        g[i][j] = 1;
      else if (c == '#')
        g[i][j] = 2;
    }
  }
  int64_t c = 1, pos = 1, ori = 1, ma = 0;
  set<int64_t> s1, s2;
  int64_t ok = 1, ans = 0;
  for (int64_t i = 0; i <= m + 1; i++)
    if (g[c][i]) s1.insert(i);
  for (int64_t i = 0; i <= m + 1; i++)
    if (!g[c + 1][i]) s2.insert(i);
  while (ok) {
    if (s2.empty())
      ok = 0;
    else {
      ma++;
      if (ori) {
        auto it1 = s1.lower_bound(pos);
        auto it2 = s2.lower_bound(pos);
        int64_t el1, el2;
        el1 = *it1;
        if (it2 != s2.end())
          el2 = *it2;
        else
          el2 = m + 1;
        if (el2 < el1) {
          ans = ans + el2 - pos + 1;
          pos = el2;
          c++;
          s1.clear();
          s2.clear();
          for (int64_t i = 0; i <= m + 1; i++)
            if (g[c][i]) s1.insert(i);
          for (int64_t i = 0; i <= m + 1; i++)
            if (!g[c + 1][i]) s2.insert(i);
          if (c == n) ok = 0;
          ma = 0;
        } else {
          ans = ans + el1 - pos;
          pos = el1 - 1;
          ori = 1 - ori;
          if (g[c][el1] == 1) {
            g[c][el1] = 0;
            s1.erase(s1.find(el1));
          }
        }
      } else {
        auto it1 = s1.lower_bound(pos);
        auto it2 = s2.upper_bound(pos);
        int64_t el1, el2;
        if (it1 != s1.begin()) {
          it1--;
          el1 = *it1;
        } else
          el1 = 0;
        if (it2 != s2.begin()) {
          it2--;
          el2 = *it2;
        } else
          el2 = 0;
        if (el2 > el1) {
          ans = ans + pos - el2 + 1;
          pos = el2;
          c++;
          s1.clear();
          s2.clear();
          for (int64_t i = 0; i <= m + 1; i++)
            if (g[c][i]) s1.insert(i);
          for (int64_t i = 0; i <= m + 1; i++)
            if (!g[c + 1][i]) s2.insert(i);
          if (c == n) ok = 0;
          ma = 0;
        } else {
          ans = ans + pos - el1;
          pos = el1 + 1;
          ori = 1 - ori;
          if (g[c][el1] == 1) {
            g[c][el1] = 0;
            s1.erase(s1.find(el1));
          }
        }
      }
    }
    if (ma > 2 * m + 10) ok = 0;
  }
  if (c == n)
    cout << ans;
  else
    cout << "Never";
  return 0;
}
